
29 Mar
2007
29 Mar
'07
8:27 a.m.
On Thu, March 29, 2007 09:28, Joaquín Mª López Muñoz wrote: [snip ...]
This works, but it is quite inefficient, as mpl::find, which computes in linear time, is called for every element of Seq. The same thing can be done in one pass through the sequence as follows:
template
struct eraseVal2:mpl::copy_if mpl::_,T > > {}; Please find attached a compilable snippet showing both algorithms at work.
HTH,
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Another approach would be to use the filter_view, without copying the elements. With Kind Regards, Ovanes Markarian