fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #define AUTO(varname, expr) decltype(expr) varname = (expr)
  5.  
  6. struct foo {
  7. const AUTO(bar, 5+3);
  8. };
  9.  
  10. int main() {
  11. cout << foo{}.bar;
  12. return 0;
  13. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
8