fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. class Foo
  7. {
  8. public:
  9. bool dump_dvars()
  10. {
  11. std::for_each(begin(seq), end(seq),
  12. [this](int) -> void
  13. {
  14. std::cout << output_file.is_open() << '\n';
  15. });
  16.  
  17. return true;
  18. }
  19.  
  20. private:
  21. int seq[1];
  22. fstream output_file;
  23. };
  24.  
  25. int main()
  26. {
  27. Foo foo;
  28. foo.dump_dvars();
  29. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
0