Concepts definition fixed

This commit is contained in:
Mateusz Pusz
2018-09-28 14:18:43 -07:00
parent 40ab45b506
commit 39bc536332
4 changed files with 8 additions and 8 deletions

View File

@@ -29,14 +29,14 @@ namespace mp {
namespace detail {
template<class T, class U>
bool concept SameHelper = std::is_same_v<T, U>;
concept bool SameHelper = std::is_same_v<T, U>;
}
template<class T, class U>
bool concept Same = detail::SameHelper<T, U> && detail::SameHelper<U, T>;
concept bool Same = detail::SameHelper<T, U> && detail::SameHelper<U, T>;
template <class From, class To>
bool concept ConvertibleTo = std::is_convertible_v<From, To> &&
concept bool ConvertibleTo = std::is_convertible_v<From, To> &&
requires(From (&f)()) {
static_cast<To>(f());
};

View File

@@ -69,7 +69,7 @@ namespace mp {
}
template<typename T>
bool concept Ratio = detail::is_ratio<T>::value;
concept bool Ratio = detail::is_ratio<T>::value;
// common_ratio

View File

@@ -58,7 +58,7 @@ namespace units {
}
template<typename T>
bool concept Exponent = detail::is_exp<T>::value;
concept bool Exponent = detail::is_exp<T>::value;
// exp_less
@@ -83,7 +83,7 @@ namespace units {
// dimension
template<Exponent... Es>
using dimension = mp::type_list<Es...>;
struct dimension;
// is_dimension
namespace detail {
@@ -95,7 +95,7 @@ namespace units {
}
template<typename T>
bool concept Dimension = detail::is_dimension<T>::value;
concept bool Dimension = detail::is_dimension<T>::value;
// make_dimension

View File

@@ -46,7 +46,7 @@ namespace units {
}
template<typename T>
bool concept Quantity = detail::is_quantity<T>::value;
concept bool Quantity = detail::is_quantity<T>::value;
// treat_as_floating_point