Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding Non-owning Pointer works in static injector but not in runtime injector #536

Open
BpsTheCool opened this issue Mar 10, 2022 · 0 comments

Comments

@BpsTheCool
Copy link

Expected Behavior

to build.

Actual Behavior

boost/di/extension/providers/runtime_provider.hpp:125: error: no matching function for call to ‘boost::ext::di::v1_2_0::extension::detail::injector<boost::ext::di::v1_2_0::extension::assert_error_policy, boost::ext::di::v1_2_0::extension::shared_config>::make<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, int, int&, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>::given>(const boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, int, int&, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>&)’

boost/di/extension/providers/runtime_provider.hpp: In instantiation of ‘void boost::ext::di::v1_2_0::extension::detail::injector<TErrorPolicy, TScopeTraits>::install(const T&) [with T = boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, int, int&, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>; typename std::enable_if<(! std::is_base_of<boost::ext::di::v1_2_0::core::injector_base, T>::value), int>::type = 0; TErrorPolicy = boost::ext::di::v1_2_0::extension::assert_error_policy; TScopeTraits = boost::ext::di::v1_2_0::extension::shared_config]’:

required from here
boost/di/extension/providers/runtime_provider.hpp:125:45: error: no matching function for call to ‘boost::ext::di::v1_2_0::extension::detail::injector<boost::ext::di::v1_2_0::extension::assert_error_policy, boost::ext::di::v1_2_0::extension::shared_config>::make<boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, int, int&, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>::given>(const boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, int, int&, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>&)’
125 | return make(binding);
| ^
boost/di/extension/providers/runtime_provider.hpp:158:8: note: candidate: ‘template<class T, class TBinding> decltype (((boost::ext::di::v1_2_0::extension::detail::injector<TErrorPolicy, TScopeTraits>)this)->make_impl(typename boost::ext::di::v1_2_0::ctor_traits::type{})) boost::ext::di::v1_2_0::extension::detail::injector<TErrorPolicy, TScopeTraits>::make(const TBinding&) [with T = T; TBinding = TBinding; TErrorPolicy = boost::ext::di::v1_2_0::extension::assert_error_policy; TScopeTraits = boost::ext::di::v1_2_0::extension::shared_config]’
158 | auto make(const TBinding &) -> decltype(make_impl(typename ctor_traits::type{})) {
| ^~~~
boost/di/extension/providers/runtime_provider.hpp:158:8: note: template argument deduction/substitution failed:
boost/di/extension/providers/runtime_provider.hpp: In substitution of ‘template<class T, class TBinding> decltype (((boost::ext::di::v1_2_0::extension::detail::injector<boost::ext::di::v1_2_0::extension::assert_error_policy, boost::ext::di::v1_2_0::extension::shared_config>
)this)->make_impl(typename boost::ext::di::v1_2_0::ctor_traits::type{})) boost::ext::di::v1_2_0::extension::detail::injector<boost::ext::di::v1_2_0::extension::assert_error_policy, boost::ext::di::v1_2_0::extension::shared_config>::make<T, TBinding>(const TBinding&) [with T = int&; TBinding = ]’:
boost/di/extension/providers/runtime_provider.hpp:125:45: required from ‘void boost::ext::di::v1_2_0::extension::detail::injector<TErrorPolicy, TScopeTraits>::install(const T&) [with T = boost::ext::di::v1_2_0::core::dependency<boost::ext::di::v1_2_0::scopes::instance, int, int&, boost::ext::di::v1_2_0::no_name, void, boost::ext::di::v1_2_0::core::none>; typename std::enable_if<(! std::is_base_of<boost::ext::di::v1_2_0::core::injector_base, T>::value), int>::type = 0; TErrorPolicy = boost::ext::di::v1_2_0::extension::assert_error_policy; TScopeTraits = boost::ext::di::v1_2_0::extension::shared_config]’
required from here
boost/di/extension/providers/runtime_provider.hpp:158:8: error: no type named ‘type’ in ‘struct boost::ext::di::v1_2_0::ctor_traits<int&, int>’

Steps to Reproduce the Problem

run Binding Non-owning Pointer example with runtime injector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant