fork download
  1. #include <iostream>
  2.  
  3. struct A{
  4. int a = 42;
  5. int b = [this](){
  6. return a * 4;
  7. }();
  8. };
  9.  
  10. int main() {
  11. A a;
  12. std::cout << a.b << std::endl;
  13. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
168