P
Paul Escherton
I'm trying to templatize the operator(), but VisualStudio .NET 2003 I
get an odd error. I'm wondering if there is a way to do this and what
the proper syntax is. If there is not, why not?
My code looks like:
class DaClass
{
public:
template <class T> T operator( ) ( )
{
return T;
}
};
and I attempt to call the operator like this:
DaClass daClass;
daClass<bool>( );
daClass<bool>operator( );
I get an error on both the lines where I try to call the operator of:
'type 'bool' unexpected'.
Any thoughts? Thanks in advance.
get an odd error. I'm wondering if there is a way to do this and what
the proper syntax is. If there is not, why not?
My code looks like:
class DaClass
{
public:
template <class T> T operator( ) ( )
{
return T;
}
};
and I attempt to call the operator like this:
DaClass daClass;
daClass<bool>( );
daClass<bool>operator( );
I get an error on both the lines where I try to call the operator of:
'type 'bool' unexpected'.
Any thoughts? Thanks in advance.