Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <optional>
  3. #include <functional>
  4. using namespace std;
  5. class A
  6. {
  7. public:
  8.   A(const A& a){cout<<"copy"<<endl;}
  9.   A(){}
  10. };
  11. void foo(std::optional<A> a)
  12. {
  13.    
  14. }
  15.  
  16. int main()
  17. {
  18.     A a;
  19.     foo(nullopt);
  20.     foo(a);
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement