Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <memory>
- #include <future>
- using namespace std;
- using Pii = pair<int, int>;
- void printPair(const Pii &pii) {
- cerr << pii.first << ' ' << pii.second << endl;
- }
- int main() {
- auto sp = make_shared<Pii>(1, 2);
- shared_ptr<Pii> sp2 = sp;
- printPair(*sp2);
- cerr << sp.use_count() << endl;
- cerr << sp.get() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement