Open 01Pollux opened 4 months ago
I confirm the issue. The workaround is to use kgr::service<System2, kgr::autowire>
or your alias. This is caused by the alias autowire_service
pointing to the wrong type.
For the moving two time, this is a consequence of how kangaru 4 is designed. kangaru 5 won't have this issue.
Describe the bug Attempting to use
container.service<>
on a service that implementsautowire_service
, will result in copy of the object rather than move since its usingsingle_service
instead ofservice
. https://github.com/gracicot/kangaru/blob/ab498eb9db0de74ffebc46f395b9a31093017412/include/kangaru/autowire.hpp#L169-L173To Reproduce 1- Create
main.cpp
with the following content:Expected behavior The program should not make copies of the service but instead move it around the output for the previous sample:
Desktop (please complete the following information):
Additional context Another note i've noticed is that it moves the object two times instead of once.