Class A {public: virtual void runs () = 0;}; Class B: Public A {public: void run () Figure {std :: cost a = std :: make_unique (new b ()); The rules for the class class are 'A' {renun avalowed_ptr (new _TP (STD :: Forward (__ args) ...)); }, Because the following virtual functions are in 'a': Class a {virtual virtual A :: Run () 'void void run () = 0; Is it because the A_PTR of an abstract class cannot continue as an argument? 8 Comments 00% upvoted log in or register to leave comments log insign131sort of: Best Tel 1 · 3Y NOT due to a single cursor, but simply cannot be subject to abstract types.
*
Inadvertently need a standard library to do this.
*
Or do this (in C ++ 11) STD :: unique_ptr (new B ( / * args * /)) or (favorite route in C ++ 14) std :: Make_Unique ( / * args * /) Mixing in both methods, which means the standard library created (trying to create a cursor): see Unique_PTR (new _TP (STD :: Forward (__ args) ...) '' In other words, letters, letters The Standard Institute has taken its new expression as a argument in building a de a de a de a de a to see the difference: std :: unique_ptr (new b ( / * args * /) // C ++ 11std :: Make_Unique ( / * args * /) // C ++ 14STD :: Make_Unique (New b ( / * args * /) // What new key do you have to use when creating a single pointer?: Unique_pt R A = STD :: Make_Unique (); 21311RPY SHARE 313131313333313131 Thanks, Mark.
*
3Y , If ​​you remember old C ++ 98: Base * B = new derivative (); As a basic class pointer and nothing to know about the real class is used to imbue the object, can be declared on the right and therefore, therefore, Extracted in a factory: Base * b = b = -Toniver vivebject (); Smart hands also behave: unique_pt s = make_unique (); Give attributes for a single_PTR: through C ++ 14 Make_unique (U Args ...), which is internal T (Args ...) and the overload of the manufacturer C ++ 11 requires an object Lô hiện có: UNIQU_PTR ( .
*
the cpp_questions community Continue browsing in r/cpp_questions r/cpp_questions a subcheapcheapcialis.com for c++ questions and answers 49.4k Members 117 Online Created Jan 15, 2012 Join Top posts january 24th 2019Top posts of january, 2019Top posts 2019 helpcheapcheapcialis.com coinscheapcheapcialis.com premiumcheapcheapcialis.
*
COM Gifts aboutcareerspresadverseblogtermcontnt polyprivacymod poly back to top