forked from mpusz/mp-units
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:
@@ -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)
|
||||
|
||||
@@ -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>{};
|
||||
|
||||
Reference in New Issue
Block a user