Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2003-12-14 18:15:13


"Reece Dunn" <msclrhd_at_[hidden]> wrote in message
news:BAY7-F101ohZrKNrwdV0003352c_at_hotmail.com...
> Jonathan Turkanis wrote:
>
> >I have occassionally used mpl::bool_ as a tool for compile-time dispatch
> >based on a boolean condition. <snip>
> As for the example not being self-documenting, could you not do something
> like:
>
> namespace detail
> {
> typedef mpl::true_ integral_type;
> typedef mpl::false_ nonintegral_type;
>
> <snip>
> }
>

Thanks.

I like using bool_ because its totally self-contained. If I wan't to be
self-documenting, I usually write something like this:

        namespace detail { template<bool B> struct is_integral_tag { }; }

Regards,

Jonathan


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