fork download
  1. namespace my
  2. {
  3. template <typename> struct less;
  4. template <typename, typename> struct pair;
  5. template <typename> struct page_allocator;
  6. template <typename> struct cached_alloc;
  7. template <typename, typename, typename, typename, typename, typename> struct set_base {};
  8.  
  9. struct select1st;
  10. struct ins_unique;
  11.  
  12. // my custom map
  13. template<typename K, typename V, typename order = less<K>, typename allocator = cached_alloc<page_allocator<pair<K,V> > > >
  14. class map : public set_base<pair<K, V>, K, select1st, order, ins_unique, allocator>
  15. {
  16. };
  17. }
  18.  
  19. template <typename T>
  20. class Base
  21. {
  22. protected:
  23. typedef my::map<T, double> MyMap;
  24. MyMap m_map; // this is line NN
  25.  
  26. public:
  27. void func(const T& key)
  28. {
  29. typename MyMap::iterator it = m_map.find(key);
  30. if(it != m_map.end()) {
  31. // ....
  32. }
  33. }
  34. };
  35.  
  36. class Inherited1 : public Base <char>
  37. { };
  38. class Inherited2 : public Base <int>
  39. { };
  40.  
  41. int main() {}
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty