Boost logo

Boost :

From: joaquin_at_[hidden]
Date: 2008-07-09 03:02:10

Hi Daryle

Daryle Walker escribió:
> Here's what I'm trying (to redo integer_test.cpp)
> ( (boost::is_same<distinct_integral_bit_counts,
> boost::mpl::list_c<int, 8, 16, 32, 64> >) );
> }
I think there are two problems with this:

1. You're passing a *type* (boost::is_same<...>) to BOOST_STATIC_ASSERT
when you should be passing a numeric contanst. Append ::value to the type.
2. Even with the correction above the thing won't work because
is_same<T,Q> checks
for strict equality of the types T and Q; in your case
is *not* the same type as boost::mpl::list_c<...>, but only has the same
You can use boost::mpl::equal to test this:

( (boost::mpl::equal<distinct_integral_bit_counts,
  boost::mpl::list_c<int, 8, 16, 32> >::value) );

Other than that, your type_to_digit_count is perfectly lambda-cabable

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Boost list run by bdawes at, gregod at, cpdaniel at, john at