fork download
  1. #include <vector>
  2. using namespace std;
  3.  
  4. class my_vec: vector<int>
  5. {
  6. public:
  7. using vector<int>::push_back;
  8. };
  9.  
  10. int main()
  11. {
  12. my_vec x;
  13. x.push_back(0);
  14. vector<int> &y = x;
  15. }
Compilation error #stdin compilation error #stdout 0s 3468KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:22: error: ‘std::vector<int>’ is an inaccessible base of ‘my_vec’
     vector<int> &y = x;
                      ^
prog.cpp:14:18: warning: unused variable ‘y’ [-Wunused-variable]
     vector<int> &y = x;
                  ^
stdout

Standard output is empty