Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2005-01-07 09:37:59


Aleksey Gurtovoy wrote:
> In his case, 'to' is an unbound family of types ('A<X>' for any 'X'),
> so 'is_convertible' won't do it. May be we should consider getting
> this in the library, in some form. E.g. tweak 'is_convertible' to
> support something like
>
> is_convertible<from, A<_> >

Or something like

    exists<_1, /* such that */ is_convertible<from, A<_1> > ;//-)

Quite often, I suppose, is enough to specify a sequence of candidate
types and then call

    mpl::find_if<candidates, is_convertible<from, A<_> > >

(It would be very funny to generalize mpl sequence concept to support
infinite sequences of unknown elements to cover this case :-)))

-- 
Alexander Nasonov

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk