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
Multiple fruit::Assisted arguments and registerFactory caused NoBindingFoundError of std::function #12
Comments
Well, I played with factory and ASSISTED a bit more and I'm now more certain there's a bug somewhere. The following would not compile. I guess it's related to my issue.
Compilation error:
|
Thanks for the report, it was indeed a bug. |
FYI, I now released 2.0.1 with this fix and the binary packages have been updated. Please update to get the fix. |
I gave 2.0.1 a try. It indeed fixed the problem. Thanks a lot! |
… were multiple non-assisted parameters with different types. This is related (but not the same as) issue #12.
Now 2.0.2 has been released with the fix to the other related bug. |
I'm trying to evaluate if i can use fruit for something production. Either I'm using fruit::Assisted wrongly or there's a bug somewhere with registerFactory or Assisted.
When the constructor of a class has multiple Assisted arguments. Compilation fails with an error like this:
To reproduce the error, create a simple class like this:
TransientMultiplier needs an injected Transient& in its constructor. suffix and index are value types that are supposed to be passed at runtime so they are marked as Assisted
This looks okay to me. But it does not compile, with a NoBindingFoundError that looks very confusing.
I can go around the problem by putting suffix and index in a std::tuple<string, int>. But that's very inconvenient. So can we not put multiple fruit::Assisted arguments in the same constructor of a class that's going to be binded via registerFactory?
I'm using libfruit Version: 2.0.0-0 on Ubuntu 14.04 installed from this deb:
deb http://download.opensuse.org/repositories/home:/poletti_marco/xUbuntu_14.04/ /
The text was updated successfully, but these errors were encountered: