Website Summary Files Commits Branches @commit @diff @stats
path: root / Smart_pointers
diff options
context:
space:
mode:
1 files changed, 1 insertions, 1 deletions
-rw-r--r--Smart_pointers/1. uniqe_ptr.cpp (renamed from Smart_pointers/1. uniqe_ptr)2
diff --git a/Smart_pointers/1. uniqe_ptr b/Smart_pointers/1. uniqe_ptr.cpp
index 6c8ef6b..c5637a4 100644
--- a/Smart_pointers/1. uniqe_ptr
+++ b/Smart_pointers/1. uniqe_ptr.cpp
@@ -46,7 +46,7 @@ int main()
unique_ptr<Test> smart_pointer_2(new Test());
- unique_ptr<Test> smart_pointer_3 = move(smart_pointer_2);
+ unique_ptr<Test> smart_pointer_3 = move(smart_pointer_2);
// unique_ptr<Test> smart_pointer_3(smart_pointer_2); //този синтаксис (както и оператор =) не е валиден! Те бяха валидни в стария и не толкова иползван auto_ptr.
smart_pointer_2.get(); // Това ще даде NULL, защото smart_pointer_3 "открадна" обекта на smart_pointer_2