I'm using GCC 9.2.0 and boost 1.55.
I have 2 vectors:
vector< pair< string, int > > source;
vector< string > dest;
I need to transform the source
vector to the dest
, such that it should contain only string
elements of source
vector.
Is it possible using boost::push_back
and adaptors?
boost::range::push_back( dest, source | /* adaptor ??? */ );
Currently I have this workable code, but it should be changed:
transform( source.begin(), source.end(), back_inserter(dest), __gnu_cxx::select1st< std::pair< std::string, int > >() );