
4 Feb
2009
4 Feb
'09
2:41 p.m.
Nigel Stewart wrote:
Personally, I've had much use of a custom made match<Type>() adaptor (using the Boost.RangeEx pipe syntax), that performs a transform with dynamic_pointer_cast and then filters null results.
The idea would be to skip items that dynamic cast to NULL in the operator++() and operator--()? Except that I'm not sure how to detect the end of the container... ... sounds interesting...
range | match<Type>() is just like range | transformed(dynamic_cast_<Type>(_1)) | filtered(_1) (assuming my lambdas are correct)