$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: chun ping wang (cablepuff_at_[hidden])
Date: 2007-12-05 02:43:43
Say lets say i have container of regular type T.
And lets say i want to insert them into ptr_vector by getting the keys.
template< typename MapType, typename OutputIterator >
OutputIterator getKeys(const MapType& map, OutputIterator out )
{
typedef typename MapType::value_type map_type;
typedef typename OutputIterator::value_type out_type;
std::for_each(map.begin(), map.end(),
boost::lambda::var(*out)++ =
boost::lambda::construct<out_type>(boost::lambda::bind(&map_type::first,
boost::lambda::_1))
);
return out;
}
Is it possble to do this. Assuming outputiterator is implemented for
ptr_vector.