Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
GlobalSpecCodeBlocks.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <vector>
5
6namespace SpecsCpp {
7
9 std::vector<std::function<void()>> _codeBlocks;
10
11 public:
14 return instance;
15 }
16
17 void register_code_block(std::function<void()> codeBlock) {
18 _codeBlocks.push_back(std::move(codeBlock));
19 }
20
22 for (auto& codeBlock : _codeBlocks) codeBlock();
23 }
24 };
25}
static GlobalSpecCodeBlocks & instance()
void register_code_block(std::function< void()> codeBlock)
Definition API.h:3