7

This one is a jargon question. There are several umbrella terms to group logical operations in C++. For example:

  • for the destructor, copy/move assignment and constructors: the copy control operations.

Is there one term for all constructors that create an object without copying or moving from another object of the same class ?

Ad N
  • 7,930
  • 6
  • 36
  • 80
  • I wouldn't necessarily call the copy constructor as not "from scratch" when it comes to things like object slicing. Therefore I would not have thought that such a term exists. Good question though. – Bathsheba Oct 21 '15 at 10:16
  • @Bathsheba Perhaps I missunderstood your comment, but I would **not** either call the copy constructor "from scratch", quite the opposite (even if it is technically creating another instance totally separated from the first one). I just sometime find myself willing to refer to the group of of all constructors except copy and move. – Ad N Oct 21 '15 at 10:19
  • Sorry, missed out a not. What I was trying to say is that I believe any distinction would be too blurred for it to be meaningful. – Bathsheba Oct 21 '15 at 10:20
  • @Bathsheba You could easily be right! This distinction can be useful in some specific cases, but it does not mean that it can be applied widely enough to have a 'standard' name. Let this question be a probe ;) – Ad N Oct 21 '15 at 10:23
  • We have [**direct initialization**](http://en.cppreference.com/w/cpp/language/direct_initialization), when you, _e.g._, construct an object using a set of (non-self) arguments. – Felix Glas Oct 21 '15 at 10:57
  • 1
    The standard uses the phrase "copy/move constructor" to (trivally) group the copy and move constructors, so "non-copy/move constructor" is probably the best you can do. – Vaughn Cato Oct 21 '15 at 12:06
  • @VaughnCato Yes, if you want a name for "everything except what is describe by term X", "not term X" is sort of obvious. Lacking a *reason* to talk about them as a group, it is probably also optimal. AdN: Why do you want this term? – Yakk - Adam Nevraumont Oct 21 '15 at 13:50
  • I wanted this term because, in our current project, we have a logic distinction between the "non-copy/move" ctors, that make a new object and add it to a registry, and the copy/move ctors, that behave a bit differently. I was wondering if there was a standard way to refer to those, more out of curiosity than anything else. As **VaughnCato** pointer out, the negation works for practical purposes ;) – Ad N Oct 21 '15 at 14:01

1 Answers1

0

No.

You also have "default constructor" and "converting constructor", but I don't think they have a common term describing them all.

Community
  • 1
  • 1
Bo Persson
  • 90,663
  • 31
  • 146
  • 203
  • Thank you for your input. Both of them would be under this same group missing a name. – Ad N Oct 21 '15 at 10:55