Description
Add a regression test covering multiple registrations made through the same bound glue object.
For example:
auto glue_ball = m.make<A>();
glue_ball.fold(...);
glue_ball.transform(...);
Previously, phlex/core/glue.hpp moved bound_obj_ into the first registration's algorithm_bits or delegate. That left the glue object without its bound shared_ptr, so subsequent registrations could receive an empty object pointer and fail when invoking a member function.
The implementation now copies bound_obj_ into each registration, allowing the shared object to remain available for reuse.
Required regression coverage
- Register at least two member-function nodes from one
glue<T> instance.
- Execute the graph and verify both nodes run successfully.
- Cover the relevant registration paths, at minimum
transform, and preferably fold or output as appropriate.
- Ensure the test would fail under the previous
std::move(bound_obj_) implementation.
Related code
phlex/core/glue.hpp
phlex/metaprogramming/delegate.hpp
- Existing class registration coverage in
test/class_registration.cpp
Description
Add a regression test covering multiple registrations made through the same bound glue object.
For example:
auto glue_ball = m.make<A>(); glue_ball.fold(...); glue_ball.transform(...);Previously,
phlex/core/glue.hppmovedbound_obj_into the first registration'salgorithm_bitsor delegate. That left the glue object without its boundshared_ptr, so subsequent registrations could receive an empty object pointer and fail when invoking a member function.The implementation now copies
bound_obj_into each registration, allowing the shared object to remain available for reuse.Required regression coverage
glue<T>instance.transform, and preferablyfoldoroutputas appropriate.std::move(bound_obj_)implementation.Related code
phlex/core/glue.hppphlex/metaprogramming/delegate.hpptest/class_registration.cpp