Guest User

Untitled

a guest
Jun 13th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <deque>
  2.  
  3. template <class T>
  4. class SomeClass {
  5. typedef std::deque<T> the_deque;
  6. typedef the_deque::iterator the_iterator;
  7. };
  8.  
  9. ## GCC error (i686-apple-darwin9-g++-4.0.1)
  10.  
  11. d.cpp:6: error: type 'std::deque<T, std::allocator<_CharT> >' is not derived from type 'SomeClass<T>'
  12. d.cpp:6: error: expected ';' before 'the_iterator'
  13.  
  14. ## Solution after tinkering in an hour and a half
  15.  
  16. Add “typename” after the second typedef keyword.
Add Comment
Please, Sign In to add comment