#include <vector> using namespace std; class my_vec: vector<int> { public: using vector<int>::push_back; }; int main() { my_vec x; x.push_back(0); vector<int> &y = x; }
Standard input is empty
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;
^
Standard output is empty