// // Copyright (c) 2012-2020 Kris Jusiak (kris at jusiak dot net) // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // //<- #include //-> #include namespace di = boost::di; auto name = [] {}; struct ctor_inject { /*<>*/ BOOST_DI_INJECT(ctor_inject, int i1, (named = name) int i2) { assert(i1 == 0); assert(i2 == 42); } }; struct ctor_inject_traits { /*<>*/ BOOST_DI_INJECT_TRAITS(int, (named = name) int); explicit ctor_inject_traits(int i1, int i2 = 0) { assert(i1 == 0); assert(i2 == 42); } }; struct ctor_di_traits { /*<>*/ explicit ctor_di_traits(int i1, int i2 = 0) { assert(i1 == 0); assert(i2 == 42); } }; namespace boost { inline namespace ext { namespace di { template <> struct ctor_traits { /*<>*/ BOOST_DI_INJECT_TRAITS(int, (named = name) int); }; } // namespace di } // namespace ext } // namespace boost struct ctor_inject_traits_no_limits { /*<>*/ using boost_di_inject__ = di::inject; ctor_inject_traits_no_limits(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) {} }; int main() { /*<>*/ // clang-format off auto injector = di::make_injector( di::bind().named(name).to(42) ); // clang-format on /*<>*/ injector.create(); injector.create(); injector.create(); injector.create(); }