Use of 'using' keyword to make inherited constructor public [duplicate]
问题 This question already has an answer here : C++11 inheriting constructors and access modifiers (1 answer) Closed 5 years ago . I am trying to test protected methods and constructors of my class. For this purpose, I tried to subclass it, and re-export its members as public with C++11 using keyword: class Foo { protected: Foo(int i) {} void run() {} }; class TestableFoo : public Foo { public: using Foo::Foo; using Foo::run; }; int main() { TestableFoo foo(7); foo.run(); } However, both g++ and