Binding an lvalue reference shouldn't cause a dangling reference.
Maybe I'm misunderstanding the library design here and it's expected that bound objects have a longer lifetime than the injector. It's definitely very easy to run into this problem. If I move the object into the binding the ownership is moved to the injector and everything is fine. I'm wondering if there's a way to make this problem more obvious or less easy to run into it.
Expected Behavior
Binding an lvalue reference shouldn't cause a dangling reference.
Maybe I'm misunderstanding the library design here and it's expected that bound objects have a longer lifetime than the injector. It's definitely very easy to run into this problem. If I move the object into the binding the ownership is moved to the injector and everything is fine. I'm wondering if there's a way to make this problem more obvious or less easy to run into it.
Actual Behavior
Reference to object is dangling.
Steps to Reproduce the Problem
Open the godbolt playground: https://godbolt.org/z/E5v4bhsE4
Specifications