L
lhr_cool_guy
C++ doesn't allow partial specialization of function templates. I want
to know why this is so? Is the concept of function template partial
specialization not well defined? I have a case where I feel there is a
genuine need for it. Please take a look and tell me if there is a
workaround:
template< class T, class allocator >
class A
{
/* ... */
public:
/* ... */
template< class U, class B >
A( const A< U, B > & ref ) { /* ... */ } // General copy constructor
/* Now I want to write a special copy constructor for A< T, B>, i.e.,
the first function template parameter is the same as the first template
parameter of class A, while the second is any general parameter. How do
I do this? */
};
to know why this is so? Is the concept of function template partial
specialization not well defined? I have a case where I feel there is a
genuine need for it. Please take a look and tell me if there is a
workaround:
template< class T, class allocator >
class A
{
/* ... */
public:
/* ... */
template< class U, class B >
A( const A< U, B > & ref ) { /* ... */ } // General copy constructor
/* Now I want to write a special copy constructor for A< T, B>, i.e.,
the first function template parameter is the same as the first template
parameter of class A, while the second is any general parameter. How do
I do this? */
};