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

Class service

example/bindings.cpp:31–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29//->
30
31struct service {
32 BOOST_DI_INJECT(service, const std::shared_ptr<interface1>& sp, bool b, int i, std::function<int()> f,
33 (named = int_name) const int ni)
34 : sp(sp) {
35 assert(dynamic_cast<implementation1_2*>(sp.get())); // overridden
36 assert(!b); // default initialization
37 assert(i == 42);
38 assert(f() == 87);
39 assert(ni == 123);
40 }
41
42 std::shared_ptr<interface1> sp;
43};
44
45struct app {
46 BOOST_DI_INJECT(app, service copy, std::shared_ptr<interface1> sp, std::unique_ptr<interface2> ap, int i,

Callers

nothing calls this directly

Calls 2

fFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected