| 42 | }; |
| 43 | |
| 44 | int main() { |
| 45 | namespace di = boost::di; |
| 46 | |
| 47 | // clang-format off |
| 48 | const auto injector = di::make_injector( |
| 49 | di::bind<Drawable>.to<Circle>(), |
| 50 | di::bind<std::ostream>.to(std::cout) |
| 51 | ); |
| 52 | // clang-format on |
| 53 | |
| 54 | injector.create<Example>().draw(); // prints Circle |
| 55 | } |
| 56 | #else |
| 57 | int main() {} |
| 58 | #endif |