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

no instance of function template "boost::di::v1_0_2::make_injector" matches the argument list #302

Closed
nicholasc opened this issue Feb 20, 2018 · 3 comments

Comments

@nicholasc
Copy link

Expected Behavior

Using the basic example from the readme, I would expect the following code to compile:

const auto injector = di::make_injector(
  di::bind<int>.to(42),
  di::bind<double>.to(87.0)
);

Actual Behavior

I get a compile error

no instance of function template "boost::di::v1_0_2::make_injector" matches the argument list
71		            argument types are: (dependency, dependency)

Steps to Reproduce the Problem

  1. Use the Quick guide - Create object graph example in the readme

Specifications

  • Version: 1.0.2
  • Platform: Windows 10
  • Subsystem: Microsoft Visual Studio Community 2017 Version 15.5.2

I know this is a long shot. Let me know if I need to provide additional information.

@kris-jusiak
Copy link
Collaborator

Thanks, @nicholasc.

I think MSVC still doesn't support DI variable template usage. Hence, you have to put () after bind.

di::bind<int>().to(42)
di::bind<double>().to(87.0)

Working example here -> https://godbolt.org/g/vBp3hD

Hopefully, that will help.

@nicholasc
Copy link
Author

Well that was simple... Thanks @krzysztof-jusiak.

Should this be documented in the readme or somewhere else?

@garyng
Copy link

garyng commented Aug 13, 2018

Same environment as OP, the code still compiles, but it still shows up as errors. Any ideas?

image

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

3 participants