Boost logo

Boost :

From: Grégory Pakosz (gpakosz_at_[hidden])
Date: 2007-04-20 04:20:49


John Maddock <john <at> johnmaddock.co.uk> writes:

>
> Grégory Pakosz wrote:
> > Hello,
> >
> > I'm currently having a look at boost's type traits implementation.
> > At the moment, I'm curious about is_enum. Can please someone explain
> > me
> > why add_reference is applied before testing convertibility to
> > int_convertible ???
>
> The class needs to declare an object of type T, and then try and see if it
> converts or not... but you may not be able to declare an object of type T
> (for example T may be abstract), where as you an always declare a reference
> to T, and the conversion rules work the same.
>
> HTH, John.
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>

Thank you John for the explanation.

To make things clear, if is_convertible was implemented the same way as loki's
Conversion, that is making use of a "T makeT()" function, then add_reference
would not be needed right ?

Gregory.


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