
18 Feb
2002
18 Feb
'02
2:43 p.m.
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. Doug