N
Nick Keighley
Hi,
I copy pasted this code from one of my projects to another. (I know
it should be a template, but I figure if I can't get the non-template
version there is no point in making things more complicated)
void Symbol_table::insert (const std::string name, const T* type)
{
std::auto_ptr <const T> ap_type (type); // <-- syntax error
here!
// more code...
}
This worked with one value for T but when I changed it. I got a syntax
error
'std::auto_ptr<class T>::auto_ptr<class T>(class T *)' : cannot
convert parameter 1 from 'const class CowlStatement *' to 'class
CowlStatement *'
It looks like type is const but the auto_ptr is expecting a non-const
in its
constructor. But I declared T as const!
I copy pasted this code from one of my projects to another. (I know
it should be a template, but I figure if I can't get the non-template
version there is no point in making things more complicated)
void Symbol_table::insert (const std::string name, const T* type)
{
std::auto_ptr <const T> ap_type (type); // <-- syntax error
here!
// more code...
}
This worked with one value for T but when I changed it. I got a syntax
error
'std::auto_ptr<class T>::auto_ptr<class T>(class T *)' : cannot
convert parameter 1 from 'const class CowlStatement *' to 'class
CowlStatement *'
It looks like type is const but the auto_ptr is expecting a non-const
in its
constructor. But I declared T as const!