You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include the following information in your issue:
Which version of units you are using
3.0.0 Beta 2
Which compiler exhibited the problem (including compiler version)
MSVC
Problem description
In contrast to most other compilers, MSVC does not enable empty base class optimization by default. This means that when using units on MSVC, although most method calls will be optimized away, there will be a memory overhead of at least 1 byte compared to just using plain floating point types.
Solution
As a solution, in our code base we added the empty_bases attribute to the units::unit class in case it is compiled on MSVC. This indeed removes the memory overhead.
If you approve that this should be addressed, I can create a pull request with the required changes.
The text was updated successfully, but these errors were encountered:
Please include the following information in your issue:
Which version of
units
you are using3.0.0 Beta 2
Which compiler exhibited the problem (including compiler version)
MSVC
Problem description
In contrast to most other compilers, MSVC does not enable empty base class optimization by default. This means that when using
units
on MSVC, although most method calls will be optimized away, there will be a memory overhead of at least 1 byte compared to just using plain floating point types.Solution
As a solution, in our code base we added the empty_bases attribute to the
units::unit
class in case it is compiled on MSVC. This indeed removes the memory overhead.If you approve that this should be addressed, I can create a pull request with the required changes.
The text was updated successfully, but these errors were encountered: