| 1 | #ifndef BANDIT_REGISTRAR_H |
|---|---|
| 2 | #define BANDIT_REGISTRAR_H |
| 3 | |
| 4 | #include <bandit/registration/spec_registry.h> |
| 5 | |
| 6 | namespace bandit { |
| 7 | namespace detail { |
| 8 | struct spec_registrar { |
| 9 | spec_registrar(bandit::detail::voidfunc_t func) { |
| 10 | bandit::detail::specs().push_back(func); |
| 11 | } |
| 12 | }; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | #define go_bandit \ |
| 17 | static bandit::detail::spec_registrar bandit_registrar |
| 18 | |
| 19 | #define SPEC_BEGIN(name) \ |
| 20 | go_bandit([]{ |
| 21 | #define SPEC_END \ |
| 22 | }); |
| 23 | #endif |
| 24 |