本文整理汇总了C++中Events::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ Events::Add方法的具体用法?C++ Events::Add怎么用?C++ Events::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(){
system("chcp 1251 > nul");
list<double> l1(2);
list<double> l2(4, 5);
list<double> l3(l2);
list<double> l4;
lPrint(l2);
for (int i = 0; i < 6; ++i){
l4.push_back(9.0034 + i);
}
int i = 0;
for (list<double>::iterator it = l4.begin(); it != l4.end(); ++it){
cout << "l(" << i++ << ") = " << *it << endl;
}
cout << endl;
l4.push_front(0.234);
lPrint(l4);
cout << '\n';
LPrint<double>(l4);
cout << endl;
double_list l5;
l5.assign(l4.begin(), l4.end());
lPrint(l5);
cout << endl;
double_list::iterator iter;
iter = l5.begin();
l5.insert(iter, 65.5434);
lPrint(l5);
cout << endl;
l5.erase(iter);
lPrint(l5);
l5.remove(65.5434);
cout << endl;
lPrint(l5);
cout << endl;
l5.remove_if(is_greater_ten);
lPrint(l5);
cout << "\nSorting\n";
l4.sort();
l4.sort(less<double>());
lPrint(l4);
cout << endl;
l4.sort(greater);
lPrint(l4);
cout << "\nIs list empty? " << ((l4.empty()) ? "Yes" : "No") << endl;
l4.clear();
cout << "Is list empty? " << ((l4.empty()) ? "Yes" : "No") << endl;
std::list<Event<>*> myList;
myList.push_back(new Event<>("Тест 1", "Москва", 0, EVENT_TYPE_CONFERENCE));
myList.push_back(new Event<>("Тест 2", "Москва", 0, EVENT_TYPE_CONFERENCE));
myList.reverse();
for (auto i = myList.begin(); i != myList.end(); ++i) {
cout << **i << endl;
}
myList.sort(comp);
myList.remove_if(is_test);
myList.reverse();
myList.insert(myList.begin(), new Event<>("Тест 3", "Москва", 0, EVENT_TYPE_CONFERENCE));
myList.pop_front();
myList.erase(myList.begin());
myList.push_back(new Event<>("Тест 4", "Москва", 0, EVENT_TYPE_CONFERENCE));
myList.clear();
cout << "Is list empty? " << ((myList.empty()) ? "Yes" : "No") << endl;
CObList list;
list.AddTail(new Event<>("Тест 1", "Москва", 0, EVENT_TYPE_CONFERENCE));
list.AddTail(new Event<>("Тест 2", "Москва", 0, EVENT_TYPE_CONFERENCE));
list.AddHead(new Event<>("Тест 3", "Москва", 0, EVENT_TYPE_CONFERENCE));
list.InsertAfter(list.GetHeadPosition(), new Event<>("Тест 4", "Москва", 0, EVENT_TYPE_CONFERENCE));
list.InsertBefore(list.GetTailPosition(), new Event<>("Тест 5", "Москва", 0, EVENT_TYPE_CONFERENCE));
POSITION pos;
for (pos = list.GetHeadPosition(); pos != NULL;)
{
cout << *((Event<>*) list.GetNext(pos)) << endl << endl;
}
for (pos = list.GetTailPosition(); pos != NULL;)
{
cout << *((Event<>*) list.GetPrev(pos)) << endl << endl;
}
//.........这里部分代码省略.........