We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98e5d59 commit 3a9a419Copy full SHA for 3a9a419
1 file changed
02_week/tasks/swap_ptr/swap_ptr.cpp
@@ -1,6 +1,8 @@
1
#include <stdexcept>
2
3
-
4
-void SwapPtr(/* write arguments here */) {
5
- throw std::runtime_error{"Not implemented"};
6
-}
+template<typename T>
+void SwapPtr(T& ptr1, T& ptr2) {
+ T temp = ptr1;
+ ptr1 = ptr2;
7
+ ptr2 = temp;
8
+}
0 commit comments