refactor: References are now guarded UNITS_REFERENCES with (ON by default) + examples duplicated to subdirectories

Now References can be disabled to meassure a compile time impact. Also the same examples are now provided in two subdirectories to be able to easily compare the pros and cons of every quantity construction technique.
This commit is contained in:
Mateusz Pusz committed 2021-04-06 15:57:28 +02:00
1 parent b842c3f94a
commit b982921d27
118 files changed
+2841 -71

No files matched your search

+4 -1
View File
@@ -55,7 +55,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
)
endif()
target_compile_definitions(mp-units-core INTERFACE $<$<BOOL:${UNITS_LITERALS}>:UNITS_LITERALS>)
target_compile_definitions(mp-units-core INTERFACE
$<$<BOOL:${UNITS_REFERENCES}>:UNITS_REFERENCES>
$<$<BOOL:${UNITS_LITERALS}>:UNITS_LITERALS>
)
if(DEFINED UNITS_DOWNCAST_MODE)
set(downcast_mode_options OFF ON AUTO)
+4
View File
@@ -55,10 +55,14 @@ constexpr auto operator"" _q_rad(long double l) { return angle<radian, long doub
#endif // UNITS_LITERALS
#ifdef UNITS_REFERENCES
namespace references {
inline constexpr auto rad = reference<dim_angle<>, radian>{};
} // namespace references
#endif // UNITS_REFERENCES
} // namespace units