Boost logo

Boost Users :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-02-18 09:43:03

On Monday 18 February 2002 07:21 am, you wrote:
> I want to use boost.function object as a parameter of class template:
> template< function1<void,int> F >
> class foo
> {
> // ...
> };
> but VC6 tells me "F : template parameter can never be initialized"
> why?

The template parameter 'F' is a nontype template parameter. Nontype template
parameters can only be of integral type. boost::function1<void, int> is a
class type, so it cannot be used as the type of a nontype template parameter.

We might be able to suggest an alternative construct if you give us more
information about the problem you are trying to solve.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at