I can have declaration of three constructors like
- copy constructor
C::C(const C&)
- move constructor
C::C(C&&)
C::C(const C&&)
in a class without ambiguity.
What do we call a constructor like C::C(const C&&)
? Does it have some kind of nickname?
I can come up with =delete
to explicitly prohibit users from unknowingly trying to move from const
and restricting the automatic copy fallback effect. This reminds users what they are doing.
And is there any other use of it?
Aucun commentaire:
Enregistrer un commentaire