fix c.127 example issue. (#789)

auto will deduce as unique_ptr<D> and the correct destructor will call. Anyway, this should be a bad example.
This commit is contained in:
teassy000
2017-01-31 03:32:41 +08:00
committed by Jonathan Wakely
parent 4d86abfdb4
commit 8a9bb3bc61

View File

@@ -6084,7 +6084,7 @@ A class with a virtual function is usually (and in general) used via a pointer t
void use() void use()
{ {
auto p = make_unique<D>(); unique_ptr<B> p = make_unique<D>();
// ... // ...
} // undefined behavior. May call B::~B only and leak the string } // undefined behavior. May call B::~B only and leak the string