Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2003-02-14 07:18:13


Several of the boost libraries select functionality based on the result
of some compile-time test. The result is usually stored in a
BOOST_STATIC_CONST( bool, test::value );

The current Borland compiler does not allow these values to be used as
template parameters though.

I suggest a new config macro

BOOST_NO_STATIC_CONST_AS_TEMPLATE_PARAM
and if this is defined the metafunction result is passed directly into
the template parameter

eg: [from lambda_traits]

#if defined( BOOST_NO_STATIC_CONST_AS_TEPLATE_PARAM )
  typedef
    action<
      boost::tuples::length<args_t>::value,
      function_action< boost::tuples::length<args_t>::value >
> action_type;
#else
  BOOST_STATIC_CONSTANT(int, nof_elems =
boost::tuples::length<args_t>::value);

  typedef
    action<
      nof_elems,
      function_action<nof_elems>
> action_type;
#endif

I am not sure if any other compilers would benefit from such a macro,
nor if this is misbehaviour is new to v6

-- 
AlisdairM

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