0
Good morning. I’m having problems with a library code I want to add to my project. I use Visual Studio 10, which is a bit old, with a C++ version even more. The library code follows the format:
struct MyStruct
{
private:
typedef typename std::map< int, std::string > Type;
Type m_Variable;
public:
typedef typename Type::const_iterator const_iterator;
inline const_iterator begin() const { return m_Variable.begin(); }
inline const_iterator end() const { return m_Variable.end(); }
};
When compiling, the following error appears:
error C2899: typename cannot be used Outside a template declaration
Since there is no possibility to update the language in this case, it would have some equivalent way to declare Container and const_iterator?
Thank you in advance.
And why not update the VS?
– Maniero
The headache of doing this for all employees does not compensate for the effort. This considering that there would be compatibility problems.
– Andre Atari
Does the headache of wearing something with 20 years of lag make up for it? So that’s OK.
– Maniero
Cara vc have to update the compiler, these are features of c++ 11/17, without updating the compiler there is no magic pass.
– gorn