diff --git a/src/include/units/area.h b/src/include/units/area.h index f9a97a71..588d75f4 100644 --- a/src/include/units/area.h +++ b/src/include/units/area.h @@ -30,7 +30,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Area = Quantity && std::experimental::ranges::Same; + concept bool Area = Quantity && std::Same; template using area = quantity; diff --git a/src/include/units/bits/concepts.h b/src/include/units/bits/concepts.h index 730d1770..1f32d003 100644 --- a/src/include/units/bits/concepts.h +++ b/src/include/units/bits/concepts.h @@ -22,13 +22,13 @@ #pragma once -#include +#include namespace units { template - concept bool Number = std::experimental::ranges::Regular && - std::experimental::ranges::StrictTotallyOrdered && + concept bool Number = std::Regular && + std::StrictTotallyOrdered && requires(T a, T b) { { a + b } -> T; { a - b } -> T; diff --git a/src/include/units/bits/hacks.h b/src/include/units/bits/hacks.h index 6485de28..a83800df 100644 --- a/src/include/units/bits/hacks.h +++ b/src/include/units/bits/hacks.h @@ -22,12 +22,23 @@ #pragma once +#include + namespace std { + // type_identity template struct type_identity { using type = T; }; template using type_identity_t = typename type_identity::type; -} + // concepts + using experimental::ranges::Same; + using experimental::ranges::Integral; + using experimental::ranges::DerivedFrom; + using experimental::ranges::Regular; + using experimental::ranges::StrictTotallyOrdered; + using experimental::ranges::ConvertibleTo; + +} \ No newline at end of file diff --git a/src/include/units/bits/upcasting.h b/src/include/units/bits/upcasting.h index 1f8c687b..e780624b 100644 --- a/src/include/units/bits/upcasting.h +++ b/src/include/units/bits/upcasting.h @@ -23,7 +23,7 @@ #pragma once #include -#include +#include namespace units { @@ -37,7 +37,7 @@ namespace units { requires { typename T::base_type; } && - std::experimental::ranges::DerivedFrom>; + std::DerivedFrom>; template using upcast_from = typename T::base_type; diff --git a/src/include/units/current.h b/src/include/units/current.h index 06e918ab..e6738d9d 100644 --- a/src/include/units/current.h +++ b/src/include/units/current.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Current = Quantity && std::experimental::ranges::Same; + concept bool Current = Quantity && std::Same; template using current = quantity; diff --git a/src/include/units/dimension.h b/src/include/units/dimension.h index 72721135..c6f74ab0 100644 --- a/src/include/units/dimension.h +++ b/src/include/units/dimension.h @@ -22,8 +22,8 @@ #pragma once -#include #include +#include namespace units { @@ -91,11 +91,13 @@ namespace units { // is_dimension namespace detail { + template inline constexpr bool is_dimension = false; template inline constexpr bool is_dimension> = true; + } // namespace detail template diff --git a/src/include/units/frequency.h b/src/include/units/frequency.h index f5b8b528..a8cb6c97 100644 --- a/src/include/units/frequency.h +++ b/src/include/units/frequency.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Frequency = Quantity && std::experimental::ranges::Same; + concept bool Frequency = Quantity && std::Same; template using frequency = quantity; diff --git a/src/include/units/length.h b/src/include/units/length.h index 4bdfb04c..880fca88 100644 --- a/src/include/units/length.h +++ b/src/include/units/length.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Length = Quantity && std::experimental::ranges::Same; + concept bool Length = Quantity && std::Same; template using length = quantity; diff --git a/src/include/units/luminous_intensity.h b/src/include/units/luminous_intensity.h index ac203384..3838bb8b 100644 --- a/src/include/units/luminous_intensity.h +++ b/src/include/units/luminous_intensity.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool LuminousIntensity = Quantity && std::experimental::ranges::Same; + concept bool LuminousIntensity = Quantity && std::Same; template using luminous_intensity = quantity; diff --git a/src/include/units/mass.h b/src/include/units/mass.h index a7ed4c01..1e8fe8e7 100644 --- a/src/include/units/mass.h +++ b/src/include/units/mass.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Mass = Quantity && std::experimental::ranges::Same; + concept bool Mass = Quantity && std::Same; template using mass = quantity; diff --git a/src/include/units/quantity.h b/src/include/units/quantity.h index 25dcfdfa..517aa742 100644 --- a/src/include/units/quantity.h +++ b/src/include/units/quantity.h @@ -32,7 +32,7 @@ namespace units { // is_quantity template - requires std::experimental::ranges::Same + requires std::Same class quantity; namespace detail { @@ -114,7 +114,7 @@ namespace units { } // namespace detail template - requires std::experimental::ranges::Same + requires std::Same constexpr To quantity_cast(const quantity& q) { using c_ratio = std::ratio_divide; @@ -136,7 +136,7 @@ namespace units { // quantity template - requires std::experimental::ranges::Same + requires std::Same class quantity { Rep value_; @@ -150,15 +150,15 @@ namespace units { quantity() = default; quantity(const quantity&) = default; - template Rep2> + template Rep2> requires treat_as_floating_point || (!treat_as_floating_point) constexpr explicit quantity(const Rep2& r) : value_{static_cast(r)} { } template - requires std::experimental::ranges::Same && - std::experimental::ranges::ConvertibleTo && + requires std::Same && + std::ConvertibleTo && (treat_as_floating_point || (std::ratio_divide::den == 1 && !treat_as_floating_point)) diff --git a/src/include/units/substance.h b/src/include/units/substance.h index bc3e9b44..0bc47c3c 100644 --- a/src/include/units/substance.h +++ b/src/include/units/substance.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Substance = Quantity && std::experimental::ranges::Same; + concept bool Substance = Quantity && std::Same; template using substance = quantity; diff --git a/src/include/units/temperature.h b/src/include/units/temperature.h index 87414c1d..6ee89357 100644 --- a/src/include/units/temperature.h +++ b/src/include/units/temperature.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool ThermodynamicTemperature = Quantity && std::experimental::ranges::Same; + concept bool ThermodynamicTemperature = Quantity && std::Same; template using temperature = quantity; diff --git a/src/include/units/time.h b/src/include/units/time.h index eff1399b..f695ca62 100644 --- a/src/include/units/time.h +++ b/src/include/units/time.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Time = Quantity && std::experimental::ranges::Same; + concept bool Time = Quantity && std::Same; template using time = quantity; diff --git a/src/include/units/velocity.h b/src/include/units/velocity.h index 3d6e8bec..fabbf7dd 100644 --- a/src/include/units/velocity.h +++ b/src/include/units/velocity.h @@ -31,7 +31,7 @@ namespace units { template<> struct upcasting_traits> : upcast_to {}; template - concept bool Velocity = Quantity && std::experimental::ranges::Same; + concept bool Velocity = Quantity && std::Same; template using velocity = quantity;