#include
#include
#include
using namespace std;
bool IsEven (const int& nNumber){
return ((nNumber % 2) == 0);
}
int main ()
{
vector v;
for (int nNum = 0; nNum < 10; ++ nNum)
v.push_back (nNum);
vector vecCopy (v);
// separate even values from the odd ones - even comes first.
partition (v.begin (), v.end (), IsEven);
for (size_t nItem = 0; nItem < v.size (); ++ nItem)
cout << v [nItem] << ' ';
return 0;
}