Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Partial class template specialization with maps
  2. template<typename T, typename D>
  3. const D& custIterator<T,D>::next()
  4. {
  5.     const D& obj = (*it);
  6.     if(hasNext())
  7.     {
  8.         it++;
  9.     }
  10.     return obj;
  11. }
  12.  
  13. //the above works fine
  14.  
  15. template<typename T, typename D>
  16. const D& custIterator<map<T,D>,D>::next() //error in this line
  17. {
  18.     D& obj = (*it).second;
  19.     if(hasNext())
  20.     {
  21.         it++;
  22.     }
  23.     return obj;
  24. }
  25.        
  26. std::map<T,D>