fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class eth_circle_buf
  5. {
  6. std::size_t active_packet = 0;
  7. public:
  8. eth_circle_buf()
  9. {
  10. std::cout << "Constructor called!";
  11. }
  12. };
  13.  
  14. void init()
  15. {
  16. static auto circle_buf = eth_circle_buf{};
  17. }
  18.  
  19. int main() {
  20. // your code goes here
  21. for (int i = 0; i < 10; i++)
  22. {
  23. init();
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
Constructor called!