fork download
  1. #include <iostream>
  2. using namespace std;
  3. #ifndef _MSC_VER
  4. #define __FUNCSIG__ __PRETTY_FUNCTION__
  5. #endif
  6. class Foo
  7. {
  8. public:
  9. Foo() {}
  10. void QQ() { cout << this << endl; }
  11. int a;
  12. };
  13. class Holder
  14. {
  15. public:
  16. Holder()
  17. {
  18.  
  19. }
  20. //template<class T>
  21. //Holder(T&&)
  22. //{
  23. //cout << __FUNCSIG__ << this << endl;
  24. //}
  25.  
  26. Holder(Holder&)
  27. {
  28. cout << __FUNCSIG__ << this << endl;
  29. }
  30. Foo &operator *()
  31. {
  32. return *foo;
  33. }
  34.  
  35. Foo *foo = nullptr;
  36. };
  37.  
  38. int main()
  39. {
  40. Holder h;
  41. h.foo = new Foo;
  42. [h]()
  43. {
  44. cout << "lambda" << h.foo << endl;
  45. }();
  46. return 0;
  47. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Holder::Holder(Holder&)0xffbbd67c
lambda0