| 29 | //-> |
| 30 | |
| 31 | struct 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 | |
| 45 | struct app { |
| 46 | BOOST_DI_INJECT(app, service copy, std::shared_ptr<interface1> sp, std::unique_ptr<interface2> ap, int i, |