My approach was incorrect from the start. It had to be done with templates, dependency injection and unique pointers for ownership (in my use case)
the things i found useful were comments and cpp conf about DI