CHAPTER10-38.cpp
上传用户:fjc899
上传日期:2007-07-03
资源大小:187k
文件大小:1k
- //文件名:CHAPTER10-38.cpp
- #include <map>
- #include <iostream>
- #if _MSC_VER > 1020 // if VC++ version is > 4.2
- using namespace std; // std c++ libs implemented in std
- #endif
- void main( )
- {
- multimap <int, int, less<int> > m1;
- multimap <int, int, less<int> >::value_compare vc1 = m1.value_comp( );
- multimap<int,int>::iterator Iter1, Iter2;
- Iter1= m1.insert ( multimap <int, int> :: value_type ( 1, 10 ) );
- Iter2= m1.insert ( multimap <int, int> :: value_type ( 2, 5 ) );
- if( vc1( *Iter1, *Iter2 ) == true )
- { cout << "The element ( 1,10 ) precedes the element ( 2,5 )."<< endl; }
- else
- { cout << "The element ( 1,10 ) does "<< "not precede the element ( 2,5 )."<< endl; }
- if( vc1( *Iter2, *Iter1 ) == true )
- { cout << "The element ( 2,5 ) precedes the element ( 1,10 )."<< endl; }
- else
- { cout << "The element ( 2,5 ) does "<< "not precede the element ( 1,10 )."<< endl; }
- }