c++ - question about smart pointers -


I have this snippet of code and I have class A (constructor, district, copy constructor, operator =), my question is I need to write Smart Pointers if I want this code to work completely, if not, then you can understand where Smart Pointers will be useful, thanks in advance

  A * Pa 1 = New A (A2); A const * pa2 = pa1; A const * const pa3 = pa2;  

No smart pointer is required, because none of the new tasks are thrown without You just need to:

  A * Pa 1 = New A (A2); A const * pa2 = pa1; A const * const pa3 = pa2; Remove Pa1;  

If you do not want this, please clarify your question.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -