refactor: DOWNCAST_MODE renamed to UNITS_DOWNCAST_MODE
This commit is contained in:
1 parent
68bdc82955
commit
d4d23847d8
11 files changed
+34
-34
No files matched your search
+5
-5
@@ -25,12 +25,12 @@
|
||||
#include <units/bits/external/hacks.h>
|
||||
#include <type_traits>
|
||||
|
||||
#ifdef DOWNCAST_MODE
|
||||
#if DOWNCAST_MODE < 0 || DOWNCAST_MODE > 2
|
||||
#error "Invalid DOWNCAST_MODE value"
|
||||
#ifdef UNITS_DOWNCAST_MODE
|
||||
#if UNITS_DOWNCAST_MODE < 0 || UNITS_DOWNCAST_MODE > 2
|
||||
#error "Invalid UNITS_DOWNCAST_MODE value"
|
||||
#endif
|
||||
#else
|
||||
#define DOWNCAST_MODE 1
|
||||
#define UNITS_DOWNCAST_MODE 1
|
||||
#endif
|
||||
|
||||
namespace units {
|
||||
@@ -72,7 +72,7 @@ enum class downcast_mode {
|
||||
};
|
||||
|
||||
|
||||
template<typename Target, Downcastable T, downcast_mode mode = static_cast<downcast_mode>(DOWNCAST_MODE)>
|
||||
template<typename Target, Downcastable T, downcast_mode mode = static_cast<downcast_mode>(UNITS_DOWNCAST_MODE)>
|
||||
struct downcast_dispatch : std::conditional_t<mode == downcast_mode::off, T,
|
||||
#ifdef COMP_MSVC
|
||||
downcast_child<Target, T>> {};
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
namespace units {
|
||||
|
||||
// DimensionOfT
|
||||
#if DOWNCAST_MODE == 0
|
||||
#if UNITS_DOWNCAST_MODE == 0
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -53,7 +53,7 @@ concept EquivalentUnknownDimensionOfT = Dimension<Dim> && is_derived_from_specia
|
||||
*/
|
||||
template<typename Dim, template<typename...> typename DimTemplate>
|
||||
concept DimensionOfT = Dimension<Dim> && (is_derived_from_specialization_of<Dim, DimTemplate>
|
||||
#if DOWNCAST_MODE == 0
|
||||
#if UNITS_DOWNCAST_MODE == 0
|
||||
|| EquivalentUnknownDimensionOfT<Dim, DimTemplate>
|
||||
#endif
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user