Is it possible to inherit constructors out-of-line in C++ so that they don't (say) get codegened in every translation unit? If so, how?
Asked
Active
Viewed 45 times
1

dyp
- 38,334
- 13
- 112
- 177

user541686
- 205,094
- 128
- 528
- 886
-
Interestingly, inherited ctors are _not_ specified in terms of additional functions in the derived class, but in terms of how initialization of an object with an inherited ctor works: https://eel.is/c++draft/class.inhctor.init Therefore I don't think the Standard gives you any ways to tweak code generation here... – dyp Feb 18 '21 at 14:40
-
Unless you just manually implement every constructor you want to act as though inherited. – aschepler Feb 18 '21 at 14:57