Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2006-07-28 02:19:17


Andy Little writes:
> Further the following code should work AFAICS, at least according to the
> documentation

[...]

>
> // Write a type fulfilling the Integral Constant requirements
> // http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html
> template <int N>
> struct my_int{

      typedef boost::mpl::integral_c_tag tag;

> typedef int value_type;
> static const int value = N;
> operator int ()const { return value;}
> typedef my_int type;
> };

[...]

> // Should work !
> // http://www.boost.org/libs/mpl/doc/refmanual/equal-to.html
>
> bool result = mpl::equal_to< my_int<1>,my_int<1> >::value ;

That's a documentation bug, please see the above and
http://www.boost.org/libs/mpl/doc/tutorial/numeric-metafunction.html.

OK, fixed in the sources now, thanks for the report!

-- 
Aleksey Gurtovoy
MetaCommunications Engineering

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