?? chapter9-33.cpp
字號:
//文件名:CHAPTER9-33.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
int main( )
{
set <int, less<int> > s1;
set<int, less<int> >::key_compare kc1 = s1.key_comp( ) ;
bool result1 = kc1( 2, 3 ) ;
if( result1 == true )
{
cout << "kc1( 2,3 ) returns value of true, "<< "where kc1 is the function object of s1."<< endl;
}
else
{
cout << "kc1( 2,3 ) returns value of false "<< "where kc1 is the function object of s1." << endl;
}
set <int, greater<int> > s2;
set<int, greater<int> >::key_compare kc2 = s2.key_comp( ) ;
bool result2 = kc2( 2, 3 ) ;
if(result2 == true)
{
cout << "kc2( 2,3 ) returns value of true, "<< "where kc2 is the function object of s2." << endl;
}
else
{
cout << "kc2( 2,3 ) returns value of false, "<< "where kc2 is the function object of s2." << endl;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -