Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an umbrella term for constructor/destructor methods?

Does the standard contain terminology for describing both a constructor and a destructor?

Is there a technical term or phrase that can encompass the two, but exclude all other kinds of methods?

"Lifetime" methods?


I've seen constructors called "ctors" and destructors called "dtors" but I've never seen "tors" used to describe both. Does such a phrase exist?

like image 970
Trevor Hickey Avatar asked Dec 25 '22 12:12

Trevor Hickey


1 Answers

I think the closest you are going to get is special member function but this also includes copy/move constructor and assignment , section 12 [special] says:

The default constructor (12.1), copy constructor and copy assignment operator (12.8), move constructor and move assignment operator (12.8), and destructor (12.4) are special member functions [...]

like image 161
Shafik Yaghmour Avatar answered Mar 07 '23 12:03

Shafik Yaghmour