auto Bind()
{
return di::make_injector(
di::bind<int>.in(di::singleton));
}
int main()
{
auto inj1 = Bind();
auto inj2 = Bind();
auto i1 = inj1.create<shared_ptr<int>>();
auto i2 = inj2.create<shared_ptr<int>>();
auto different = i1.get() != i2.get();
assert(different);
return 0;
}
Actual Behavior
Assertion fails.
Steps to Reproduce the Problem
Create two injectors of the same type containing a singleton scoped binding
Have each injector create a shared_ptr of that singleton object
Expected Behavior
Actual Behavior
Assertion fails.
Steps to Reproduce the Problem
Specifications