?? chapter9-36.cpp
字號:
//文件名:CHAPTER9-36.cpp
#include <set>
#include <iostream>
#if _MSC_VER > 1020 // if VC++ version is > 4.2
using namespace std; // std c++ libs implemented in std
#endif
void main( )
{
multiset <int, less<int> > ms1;
multiset <int, less<int> >::value_compare vc1 = ms1.value_comp( );
bool result1 = vc1( 2, 3 );
if( result1 == true )
{
cout << "vc1( 2,3 ) returns value of true, "<< "where vc1 is the function object of ms1."
<< endl;
}
else
{
cout << "vc1( 2,3 ) returns value of false, "<< "where vc1 is the function object of ms1."
<< endl;
}
set <int, greater<int> > ms2;
set<int, greater<int> >::value_compare vc2 = ms2.value_comp( );
bool result2 = vc2( 2, 3 );
if( result2 == true )
{
cout << "vc2( 2,3 ) returns value of true, "<< "where vc2 is the function object of ms2."
<< endl;
}
else
{
cout << "vc2( 2,3 ) returns value of false, "<< "where vc2 is the function object of ms2."
<< endl;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -