// Set_Process.cpp : Defines the entry point for the console application.
//
#include <iostream>
using std::cout;
using std::endl;
#include <set>
#include <iterator>
typedef std::set< double, std::less< double > > double_set;
int _tmain(int argc, _TCHAR* argv[])
{
const int SIZE = 5;
double a[ SIZE ] = { 2.1, 4.2, 9.5, 2.1, 3.7 };
double_set doubleSet( a, a + SIZE );
std::ostream_iterator< double > outputIt( cout, " " );
cout<<"double Set contains: ";
std::copy( doubleSet.begin(), doubleSet.end(), outputIt );
std::pair< double_set::const_iterator, bool > p;
p = doubleSet.insert( 13.8 );
cout<< "/n/n" << *(p.first)
<< ( p.second ? " was": " was not") << " inserted";
cout<<"/ndoubleSet contains: ";
std::copy( doubleSet.begin(), doubleSet.end(), outputIt );
p = doubleSet.insert( 9.5 );
cout<<"/n/n" << *( p.first )
<< ( p.second ? " was" : " was not" ) << " inserted";
cout<< "/ndoubleSet contains: ";
std::copy( doubleSet.begin(), doubleSet.end(), outputIt );
cout<<endl;
return 0;
}