foonathan / type_safe

Zero overhead utilities for preventing bugs at compile time
https://type_safe.foonathan.net
MIT License
1.54k stars 122 forks source link

Add __declspec(empty_bases) to derived structs for size optimization #128

Closed mathysie closed 2 years ago

mathysie commented 2 years ago

This ensures for example that a strong type double inheriting floating_point_arithmetic remains having the same size as a double

mathysie commented 2 years ago

Fixes issue #124

foonathan commented 2 years ago

This does not work on non-MSVC compilers, please wrap it in an appropriate macro.

foonathan commented 2 years ago

Thank you!