fork download
  1. #include <cstdio>
  2.  
  3. template<typename Func>
  4. void hoge(Func f) {
  5. puts("初期化処理内容");
  6. f(); // メイン処理内容
  7. puts("終了処理処理");
  8. }
  9.  
  10. int main(void) {
  11. hoge([]{
  12. puts("メイン処理内容");
  13. });
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
初期化処理内容
メイン処理内容
終了処理処理