Boost logo

Boost :

From: joel de guzman (djowel_at_[hidden])
Date: 2001-12-05 10:02:39


----- Original Message -----
From: "David Abrahams" :

> 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

Borland 5.5 has problems with non-type template params. What
I do is wrap the integer constant in a type2type kind of stuff. I'd
love to know another way out.

--Joel


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