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

Runtime injector does not allow lazy binding to std::function factory methods #529

Open
tripleslash opened this issue Oct 4, 2021 · 3 comments

Comments

@tripleslash
Copy link

tripleslash commented Oct 4, 2021

Expected Behavior

Runtime injector does not allow binding to lambda callbacks

Actual Behavior

Steps to Reproduce the Problem

If you wrap the following code in a runtime_injector you will get a compiler error:

        auto ctInjector= boost::di::make_injector(
            boost::di::bind<IInterface>()
                    .to([](const auto& injector)
                    {
                        return injector.template create<Implementation>();
                    })
        );
        runtimeInjector.install(ctInjector);

Specifications

  • Version:
  • Platform:
  • Subsystem:
@BpsTheCool
Copy link

Lots of things that work with normal injector does not work with runtime injector. I've got this problem too with it.

@kris-jusiak
Copy link
Collaborator

That's true, runtime injector was just an experiment as an extension. but it seems to be popular, hence, let me improve the quality of it, sorry for the delay.

@BpsTheCool
Copy link

Is there any plan to work on runtime injector? There haven't been any update.

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