Closed csukuangfj closed 5 years ago
@dirk-thomas Could you please have a look at the test failure? http://build.ros.org/job/Kpr__roscpp_core__ubuntu_xenial_amd64/46/testReport/
I think changing the destructor to be virtual would break ABI compatibility. Therefore this can only be considered for future distributions but can't be released into existing distributions.
Changing the destructor to be virtual will introduce a vtable and a vptr to the class. On a 64-bit-machine the objects size will be doubled.
ros::DurationBase
is an example for the Curiously recurring template pattern, which is a technique to implement static polymorphism.
I'd rather argue that ros::DurationBase
s desctuctor should be removed entirely , which would make it trivially copyable (see also #82). But this will also result in an ABI-break.
Closing in favor of #104.
Fix #86.