
Vyacheslav Kononenko writes:
I could not come with usable name for such thing but it could be usable anyway. So it is like find_if but applies a function to an sequence and return first non void type that function returned. So implementation would be trivial:
template< typename Sequence, typename Func > struct find_type : fold< Sequence, void_, if_< is_void_< _1 >, Func< _2 >, _1 > {};
Or, which is likely to be more efficient,
template< typename Seq, typename F > struct find_type
{
typedef typename find_if<
transform_view
If it can be implemented by current set of algorithms please point me out.
Doesn't your sketch above employ an algorithm from the current set ('fold')? In any case, at the moment this feels too specialized to me to be considered for inclusion in the library. At the very least, it needs a name ;). -- Aleksey Gurtovoy MetaCommunications Engineering