0

Why isn't it compiled:

template<typename T>
using v_itt = std::vector<T>::iterator; //error: missing 'typename' 
                             //prior to dependent type name 'std::vector<T>::iterator

demo

I use as it said in this topic. What did I miss?

Community
  • 1
  • 1
  • Where is the `typedef` in your code? – MooseBoys Jun 24 '15 at 17:27
  • @MooseBoys What are you talking about? –  Jun 24 '15 at 17:27
  • your link points to *How to typedef a template class?*. What are you trying to accomplish? – MooseBoys Jun 24 '15 at 17:28
  • @MooseBoys Have you ever read the asnwers? –  Jun 24 '15 at 17:28
  • No I didn't read all the answers in your link; questions on SO should generally be self-contained. That said, it seems like your question is specifically related to [type aliasing](http://en.cppreference.com/w/cpp/language/type_alias) in C++11. Given that, this question probably isn't a dup of the template/typename question, but it's too low quality in its current form to justify reopening. Odds are, you're simply not using a C++11-compatible compiler. – MooseBoys Jun 24 '15 at 17:37
  • 2
    @MooseBoys This question is totally reasonable, and is absolutely a dup of that question... given that the problem - as even expressed in the question itself - is the missing `typename` keyword. I don't know what you're talking about. – Barry Jun 24 '15 at 17:42
  • @Barry looks like you're right - adding a second `template` allows the code to compile. – MooseBoys Jun 24 '15 at 18:03

0 Answers0