-
-
Save velotiotech/ffeaa3cad6ef3ff4c1cd4aeab63a9c74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
int main() { | |
std::vector<std::unique_ptr<int>> numbers; | |
std::unique_ptr<int> ptr1(new int(20)); | |
std::unique_ptr<int> ptr2(new int(10)); | |
numbers.push_back(ptr1); | |
numbers.push_back(ptr2); | |
for (const auto& ptr : numbers) | |
std::cout << *ptr << " "; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment