Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy aren't C++ constructors inherited?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COYes it seems logical on such a simple example. But in more complex examples I don't want the compiler to start auto generating new constructors just because it thinks its a good idea; that may lead to all sorts of unexpected auto conversions where I don't expect them.
      singulars
    2. COBjarne Stroustrop says ([link](http://www2.research.att.com/~bs/C++0xFAQ.html#inheriting)), "In C++98, we can 'lift' a set of overloaded functions from a base class into a derived class... I have said that 'Little more than a historical accident prevents using this to work for a constructor as well as for an ordinary member function.' C++0x provides that facility..." He is referring to the `using` statement, e.g., `using Parent::Parent;`, but I wonder if the lack of constructor inheritance in general is also due to arbitrary historical reasons.
      singulars
    3. COYes C++0x has provided some extra functionality. But it is **not automatic** you need to **explicitly** indicate that you want it. What you want is everything automated and that is a **BAD** idea because it will lead to **auto type conversions** that you are not expecting. I believe it was considered (this is why C++0x allows you to import them with `using Parent::Parent;`), but your idea was rejected (but I don't have a quote).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload