ZeroCM / zcm

Zero Communications and Marshalling
http://zerocm.github.io/zcm/
GNU Lesser General Public License v2.1
233 stars 67 forks source link

Make virtual destructor optional for c++ zcmtypes #447

Closed olsoni closed 10 months ago

olsoni commented 10 months ago

Because it's a nonzero memory cost and changes the underlying memory layout of the type itself, it would be nice to be able to forgo the inclusion of the virtual destructor in c++ zcmtypes. Ideally, this could be specified in the type itself as the use case for having vs not having a virtual destructor is somewhat of a type specific one.

enricop commented 10 months ago

Hello,

making the 'virtual' attribute on the descructor optional would be great. Currently c++ autogenerated types cannot be used as is with the Boost PFR helper library:

Internally this library uses std::is_aggregate to check the struct has no virtual destructor.

https://www.boost.org/doc/libs/master/doc/html/boost_pfr.html https://github.com/boostorg/pfr

jbendes commented 10 months ago

This is such a trivial thing to add. Will add now

jbendes commented 10 months ago

pullreq up here lol: https://github.com/ZeroCM/zcm/pull/449

jbendes commented 10 months ago

implemented in https://github.com/ZeroCM/zcm/pull/449