constructor

will constructor automatic inherited by child class?
Will a base-class constructor be automatically inherited by a subclass?

Not automatically.

You can explicitly call it, however, or explicitly inherit it as in the following example:
1
2
3
4
5
6
7
8
9
struct A    { A(int) {} };   // base
struct B: A { using A::A; }; // inheriting constructor
struct C: A { C(int x): A(x) {} }; // explicit call

int main() {
    A a{0};
    B b{1}; 
    C c{2};
}

http://coliru.stacked-crooked.com/a/29c47b86d3e7c837
Just to let all know the OP is a known troll.
Topic archived. No new replies allowed.