daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top