fork download
  1. #include<vector>
  2.  
  3. template<typename T>
  4. struct MyVector : private std::vector<T>
  5. {
  6. typedef std::vector<T> vector;
  7.  
  8. using vector::begin; // ok
  9. using vector::end; // ok
  10. using vector::size; // ok
  11. using vector::operator ==; // <---- error
  12.  
  13. // Other customized methods
  14. };
  15.  
  16. int main ()
  17. {
  18. MyVector<int> v1, v2;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘struct MyVector<int>’:
prog.cpp:18:17:   required from here
prog.cpp:11:26: error: no members matching ‘MyVector<int>::vector {aka std::vector<int, std::allocator<int> >}::operator==’ in ‘MyVector<int>::vector {aka class std::vector<int, std::allocator<int> >}’
stdout
Standard output is empty