Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-12-05 08:18:24


When I pass a function pointer type as the first argument to the following:

  template <class T, std::size_t size>
  void assert_arg_tuple_size()
  {
      typedef detail::arg_tuple_size<T> size_expr;
      BOOST_STATIC_ASSERT(size_expr::value == size);
  }

Borland complains as follows:

Error E2396 ../test\test.cpp 90: Template argument must be a constant
expression in function assert_arg_tuple_size<void (*)(),0>()
Error E2299 ../test\test.cpp 90: Cannot generate template specialization
from 'STATIC_ASSERTION_FAILURE<x>' in function assert_arg_tuple_size<void
(*)(),0>()
Error E2109 ../test\test.cpp 90: Not an allowed type in function
assert_arg_tuple_size<void (*)(),0>()

Does anyone know how to subdue the compiler in this case?

Thanks,
Dave

===================================================
  David Abrahams, C++ library designer for hire
 resume: http://users.rcn.com/abrahams/resume.html

        C++ Booster (http://www.boost.org)
          email: david.abrahams_at_[hidden]
===================================================


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