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

Extension constructor with extension shared not compiling #391

Open
arude opened this issue Mar 22, 2019 · 1 comment
Open

Extension constructor with extension shared not compiling #391

arude opened this issue Mar 22, 2019 · 1 comment

Comments

@arude
Copy link

arude commented Mar 22, 2019

Expected Behavior

When I change the extension constructor binding example line
, di::bind<variadic>().to(di::extension::constructor<int, std::string, std::unique_ptr<interface>>())
to
, di::bind<variadic>().to(di::extension::constructor<int, std::string, std::unique_ptr<interface>>()).in(di::extension::shared)
it should still compile.
Added include #include <boost/di/extension/scopes/shared.hpp>

Actual Behavior

When I forward declare the variadic constructor type I get:
boost/di.hpp(517): error C2139: 'nanosurf::nsfstd::core::core_hw_modules': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_final' (compiling source file workflow_manager_mobiles.cpp)

When I have the definition I get (this is as-is with the example mentioned:
main.obj : error LNK2019: unresolved external symbol "public: static struct variadic __cdecl boost::di::v1_1_0::concepts::scoped<class boost::di::v1_1_0::extension::detail::shared,struct boost::di::v1_1_0::extension::constructor<int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::unique_ptr<struct interface,struct std::default_delete<struct interface> > > >::is_not_convertible_to<struct variadic>::error(struct boost::di::v1_1_0::_)" (?error@?$is_not_convertible_to@Uvariadic@@@?$scoped@Vshared@detail@extension@v1_1_0@di@boost@@U?$constructor@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@Uinterface@@U?$default_delete@Uinterface@@@std@@@2@@3456@@concepts@v1_1_0@di@boost@@SA?AUvariadic@@U_@456@@Z) referenced in function "public: __thiscall boost::di::v1_1_0::concepts::scoped<class boost::di::v1_1_0::extension::detail::shared,struct boost::di::v1_1_0::extension::constructor<int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::unique_ptr<struct interface,struct std::default_delete<struct interface> > > >::is_not_convertible_to<struct variadic>::operator struct variadic(void)const " (??B?$is_not_convertible_to@Uvariadic@@@?$scoped@Vshared@detail@extension@v1_1_0@di@boost@@U?$constructor@HV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@Uinterface@@U?$default_delete@Uinterface@@@std@@@2@@3456@@concepts@v1_1_0@di@boost@@QBE?AUvariadic@@XZ)

Specifications

  • Version: 1.1.0 Trunk commit 0972fdf
  • Platform: Win10, MSCV 2015U3
  • Subsystem: Win32 Debug

Thank you for your help.

@arude
Copy link
Author

arude commented Mar 22, 2019

Actually I tried now without the shared extension. If I add
struct example final { example(variadic& var) {}; };
and
injector.create<example>();

I get:
di.hpp(2445): error C2440: 'return': cannot convert from 'wrapper_t' to 'create_t '

Shouldn't this work?

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