I have this C ++ code to generate a "primary expression before". token 'with the g ++ compiler. It compiles OK with the cl compiler (MSVC).
template<typename T>
class A : public std::auto_ptr<T>
{
typedef std::auto_ptr<T> Super;
public:
A() : Super() { }
A(T* t) : Super(t) { }
A(AP<T>& o) : Super(o) { }
operator bool() { return !!Super.get(); } <--- error!
};
What is wrong with this code?
source
share