
23 Mar
2007
23 Mar
'07
2:52 p.m.
On 3/23/07, Scott Meyers
// return Seq with the first occurrance of T removed template
struct erase_first { // i = Seq.find(T) typedef typename mpl::find ::type i; // found = (i == Seq.end()) ? false : true typedef typename mpl::if_< typename boost::is_same::type, mpl::false_, mpl::true_ >::type found;
// type = found ? Seq : Seq.erase(i)
// type = found ? Seq.erase(i) : Seq
typedef typename mpl::if_
::type >::type type;
typedef typename if_
};
BOOST_MPL_ASSERT(( mpl::equal< erase_first
::type, erase_first ::type ));
Or did I misunderstand? Tony