Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-06-28 05:58:31


>That's a mouthful, so here's an example from "ice_guidelines.htm":
  ::boost::type_traits::ice_or<ICE1,ICE2>::value
but you can't declare it using BOOST_STATIC_CONSTANT:
  BOOST_STATIC_CONSTANT(bool, val =
::boost::type_traits::ice_or<ICE1,ICE2>::value);
                                                        syntax error ^

The problem is that there isn't a way to use an expression containing
commas
as a value for the 'assignment' macro argument (wrapping it in parenthesis,
the standard way to pass commas in macro arguments, will result in a syntax
error in this case).
<

What I should have said in the guidelines is that if the expression
contains commas then you need to put in parenthesis, when using the
BOOST_STATIC_CONSTANT macro:

  BOOST_STATIC_CONSTANT(bool, val =
(::boost::type_traits::ice_or<ICE1,ICE2>::value));

Which works just fine, and is used extensively in the type traits lib.

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


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