Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-07-14 16:51:13


David Abrahams wrote:

> Ultimately I think the right answer is to use
>
> mpl::integral_c<some_type, some_value>
>
> or
>
> mpl::bool_<some_value>
>
> etc.
>
> everywhere as Paul Mensonides suggested. One reason is that it
> centralizes the out-of-line static member definitions.
>

I tried this (in the algorithm/string library where I also tested the
enum trick for Pavol Droba) and just replaced in
algorithm/string/std/string_traits.hpp following lines

   enum { value = false } ;
   typedef mpl::bool_< value > type ;

with

   typedef mpl::bool_< false > value ;
   typedef mpl::bool_< value > type ;

and this evidently results in a compilation error. I am not very fluent
in mpl but AFAICT this seems like a nice solution but not exactly a
drop-in replacement for the current situation.


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