MCPcopy Create free account
hub / github.com/boost-ext/di / main

Function main

example/modules.cpp:70–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68};
69
70int main() {
71 constexpr auto i = 42;
72 constexpr auto d = 87.0;
73
74 /*<<module configuration with movable injector>>*/
75 // clang-format off
76 auto movable_injector = di::make_injector(
77 di::bind<double>().to(d)
78 );
79 // clang-format on
80
81 /*<<create injector and pass `module1`, `module2` and `exposed_module`>>*/
82 // clang-format off
83 auto injector = di::make_injector(
84 module1()
85 , module2(i)
86 , exposed_module()
87 , std::move(movable_injector)
88 );
89 // clang-format on
90
91 /*<<create `app`>>*/
92 injector.create<app>();
93}

Callers

nothing calls this directly

Calls 4

module1Function · 0.85
module2Function · 0.70
make_injectorFunction · 0.50
toMethod · 0.45

Tested by

no test coverage detected