auto Bind(int i)
{
return di::make_injector(
di::bind<int>.to(ext::shared_factory<int>([i](const auto &){
return make_shared<int>(i);
})));
}
int main()
{
auto inj = Bind(123);
auto i = inj.create<int>();
assert(i == 123);
return 0;
}
Actual Behavior
Assertion fails
Steps to Reproduce the Problem
Create a binding using shared_factory with a lambda that has a capture and returns it as its result
Create a value using that binding
The created value will not be the same as the one captured as the capture storage will have been deleted already
Expected Behavior
Actual Behavior
Assertion fails
Steps to Reproduce the Problem
Specifications