fork(2) download
  1. #include <iostream>
  2.  
  3. class A{
  4. int a;
  5.  
  6. friend int access_member(A*a){ return a->a;}
  7. };
  8.  
  9. //-----------------------------------------
  10. int main()
  11. {
  12. auto function = [](A*a){ return access_member(a); };
  13.  
  14. std::cout << function(new A) << std::endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
0