mercredi 24 février 2016

Compiler Error: Expected Nested Name Specifier before typedef

In a template class with two instantiation types (T and PT) I currently have the following line for using a const_iterator for the class:

typedef typename std::vector< std::pair<T, PT> >::const_iterator const_iterator;

This works in a C++11/14 environment however when compiling in a C++98 environment (which may, unfortunately, be required for various reasons) I get the error shown in the title, expected nested name specifier before typedef.

Is there any way I can resolve this issue for old compilers?

Aucun commentaire:

Enregistrer un commentaire