本文整理汇总了C++中ItemType::EmptyIt方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemType::EmptyIt方法的具体用法?C++ ItemType::EmptyIt怎么用?C++ ItemType::EmptyIt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemType
的用法示例。
在下文中一共展示了ItemType::EmptyIt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
ItemType testItem;
ItemType copyItem(2);
ItemType otherItem(3);
c234node testNode;
c234node copyNode(copyItem);
c234Tree testTree;
//cout << testNode;
bool ok;
PrintMessage ("ItemType::constructor", "default");
cout << "Value in the item is " << testItem;
PrintMessage ("ItemType::constructor", "item = 2");
cout << "Value in the item is " << copyItem;
ToContinue();
PrintMessage ("ItemType::IsEmpty", "empty");
PrintBool (testItem.IsEmpty());
PrintMessage ("ItemType::IsEmpty", "non-empty");
PrintBool (copyItem.IsEmpty());
ToContinue();
PrintMessage ("ItemType::EmptyIt", "empty");
cout << "Before Empty item = " << testItem;
testItem.EmptyIt();
cout << endl << "Now is it empty?";
PrintBool (testItem.IsEmpty());
PrintMessage ("ItemType::EmptyIt", "non-empty");
cout << "Before Empty item = " << copyItem;
testItem.EmptyIt();
cout << endl << "Now is it empty?";
PrintBool (testItem.IsEmpty());
ToContinue();
PrintMessage ("ItemType::oper=", "any");
cout << "Before '=' lhs item = " << copyItem << endl;
cout << "Before '=' rhs item = " << otherItem << endl;
copyItem = otherItem;
cout << "After '=' lhs item = " << copyItem << endl;
ToContinue();
testItem.setValue(3);
copyItem.setValue(1);
PrintMessage ("ItemType::oper==", "non-equal");
cout << testItem << " = " << copyItem << endl;
PrintBool(testItem == copyItem);
copyItem.setValue(3);
PrintMessage ("ItemType::oper==", "equal");
cout << testItem << " = " << copyItem << endl;
PrintBool(testItem == copyItem);
ToContinue();
PrintMessage ("ItemType::oper>", "non-greater than");
cout << testItem << " > " << copyItem << endl;
PrintBool(testItem > copyItem);
copyItem.setValue(1);
PrintMessage ("ItemType::oper>", "greater than");
cout << testItem << " > " << copyItem << endl;
PrintBool(testItem > copyItem);
ToContinue();
PrintMessage ("ItemType::oper<", "non-less than");
cout << testItem << " < " << copyItem << endl;
PrintBool(testItem < copyItem);
copyItem.setValue(5);
PrintMessage ("ItemType::oper<", "less than");
cout << testItem << " < " << copyItem << endl;
PrintBool(testItem < copyItem);
ToContinue();
PrintMessage ("c234node::constructor", "default");
cout << "Node looks like " << testNode;
PrintMessage ("c234node::constructor", "item = 5");
cout << "Node looks like " << copyNode;
//.........这里部分代码省略.........