Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are undeclared copy-constructors automatically inline?

Are undeclared (auto-generated) copy constructors automatically marked as inline?

If so, and if I don't want them to be marked as inline, does that mean I have to define one manually and copy every single member I need by hand (assuming I'm not using C++11, so that there's no = default to take advantage of)?

like image 705
user541686 Avatar asked Dec 04 '22 13:12

user541686


1 Answers

They're treated as if they were declared inline (which doesn't necessarily mean that they will be inlined). And yes, in pre-C++11, the only way to prevent their being inline was to declare and define them manually, copying every member and every base class explicitly in the initializer list.

like image 50
James Kanze Avatar answered Dec 26 '22 10:12

James Kanze