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

Function main

example/dynamic_bindings.cpp:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42int main() {
43 auto id = e1;
44
45 /*<<create interface with `id = e1`>>*/
46 auto injector = di::make_injector(dynamic_bindings(id));
47 assert(dynamic_cast<implementation1*>(injector.create<std::shared_ptr<interface>>().get()));
48
49 id = e2;
50 /*<<create interface with `id = e2`>>*/
51 assert(dynamic_cast<implementation2*>(injector.create<std::shared_ptr<interface>>().get()));
52 (void)id;
53}

Callers

nothing calls this directly

Calls 2

make_injectorFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected