Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <memory>
- #include <iostream>
- using namespace std;
- int main()
- {
- double* broj = new double(10);
- unique_ptr<double> uptr2 (broj);
- /* Zabranjeno je referencirati isti pokazivac preko unique_pointera!
- Ovako mali program ce moci da se izvrsi do kraja, uz gresku, ali u kompleksnijim aplikacijama, ovo moze biti
- ozbiljniji problem */
- unique_ptr<double> uptr3 (broj);
- cout << "Zdravo";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement