vendredi 2 février 2018

C++ weird usage of new keyword [duplicate]

This question already has an answer here:

I was trying to learn something else then i encounter with the following code.

class point{}; point p_; new (&p_) point(w.p_);

What does third line expression do, and what is intended ? Does it helps us to save time while copying or something. And is p_ somehow allocated dinamically? // I'm so confused.

The place I encountered ->> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf //Second page of the document.

Aucun commentaire:

Enregistrer un commentaire