build: Added an option to disable UDLs support

Now it is time to get rid of UDLs from tests and examples and then disable them by default.
This commit is contained in:
Mateusz Pusz
2021-04-01 09:36:55 +02:00
parent 309da80c32
commit 9054420d08
94 changed files with 371 additions and 13 deletions
+4
View File
@@ -55,6 +55,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
)
endif()
if(UNITS_UDLS)
target_compile_definitions(mp-units-core INTERFACE UNITS_UDLS=1)
endif()
if(DEFINED UNITS_DOWNCAST_MODE)
set(downcast_mode_options OFF ON AUTO)
list(FIND downcast_mode_options "${UNITS_DOWNCAST_MODE}" downcast_mode)
+4
View File
@@ -43,6 +43,8 @@ concept Angle = QuantityOfT<T, dim_angle>;
template<UnitOf<dim_angle<>> U, Representation Rep = double>
using angle = quantity<dim_angle<>, U, Rep>;
#if UNITS_UDLS
inline namespace literals {
// rad
@@ -51,6 +53,8 @@ constexpr auto operator"" _q_rad(long double l) { return angle<radian, long doub
} // namespace literals
#endif // UNITS_UDLS
namespace references {
inline constexpr auto rad = reference<dim_angle<>, radian>{};