The following code does not compile under G++ 4.8
#include <vector>
using namespace std;
int main() {
vector<int> v;
typeof(v)::iterator it;
}
If I replace typeof to decltype, it works fine. I know about a workaround with a template structure
template<class T> struct Self {
typedef T Type;
};
and then
Self<typeof(v)>::Type::Iterator it;
but still its annoying.
Is this a bug which should be reported? Or this is a feature?