bool removed from concepts definitions as gcc-9.1 supports this syntax already

This commit is contained in:
Mateusz Pusz
2019-09-28 19:10:06 +02:00
parent 4b145ea4cf
commit 952b19c2ed
40 changed files with 47 additions and 47 deletions

View File

@ -580,7 +580,7 @@ a provided base class.
namespace detail {
template<typename T>
concept bool has_downcast = requires {
concept has_downcast = requires {
downcast_guide(std::declval<downcast_base<T>>());
};

View File

@ -27,7 +27,7 @@
namespace units {
template<typename T>
concept bool Number = std::regular<T> &&
concept Number = std::regular<T> &&
std::totally_ordered<T> &&
requires(T a, T b) {
{ a + b } -> T;

View File

@ -34,7 +34,7 @@ namespace units {
};
template<typename T>
concept bool Downcastable =
concept Downcastable =
requires {
typename T::base_type;
} &&
@ -48,7 +48,7 @@ namespace units {
namespace detail {
template<typename T>
concept bool has_downcast = requires {
concept has_downcast = requires {
downcast_guide(std::declval<downcast_base<T>>());
};

View File

@ -37,7 +37,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -30,7 +30,7 @@
namespace units {
template<typename T>
concept bool BaseDimension = std::is_empty_v<T> &&
concept BaseDimension = std::is_empty_v<T> &&
requires {
{ T::value } -> std::same_as<const char*>;
};
@ -68,7 +68,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Exponent = detail::is_exp<T>;
concept Exponent = detail::is_exp<T>;
template<Exponent... Es>
struct dimension;
@ -85,7 +85,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Dimension =
concept Dimension =
std::is_empty_v<T> &&
detail::is_dimension<downcast_base_t<T>>;

View File

@ -29,7 +29,7 @@ namespace units {
struct acceleration : derived_dimension<acceleration, exp<velocity, 1>, exp<base_dim_time, -1>> {};
template<typename T>
concept bool Acceleration = QuantityOf<T, acceleration>;
concept Acceleration = QuantityOf<T, acceleration>;
struct metre_per_second_sq : derived_unit<metre_per_second_sq, acceleration, metre, second> {};

View File

@ -29,7 +29,7 @@ namespace units {
struct area : derived_dimension<area, exp<base_dim_length, 2>> {};
template<typename T>
concept bool Area = QuantityOf<T, area>;
concept Area = QuantityOf<T, area>;
struct square_millimetre : derived_unit<square_millimetre, area, millimetre> {};
struct square_centimetre : derived_unit<square_centimetre, area, centimetre> {};

View File

@ -31,7 +31,7 @@ namespace units {
struct capacitance : derived_dimension<capacitance, exp<electric_charge, 1>, exp<voltage, -1>> {};
template<typename T>
concept bool Capacitance = QuantityOf<T, capacitance>;
concept Capacitance = QuantityOf<T, capacitance>;
struct farad : derived_unit<farad, capacitance, kilogram, metre, second, ampere> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct current : derived_dimension<current, exp<base_dim_current, 1>> {};
template<typename T>
concept bool Current = QuantityOf<T, current>;
concept Current = QuantityOf<T, current>;
struct ampere : derived_unit<ampere, current> {};

View File

@ -31,7 +31,7 @@ namespace units {
struct electric_charge : derived_dimension<electric_charge, exp<base_dim_time, 1>, exp<base_dim_current, 1>> {};
template<typename T>
concept bool ElectricCharge = QuantityOf<T, electric_charge>;
concept ElectricCharge = QuantityOf<T, electric_charge>;
struct coulomb : derived_unit<coulomb, electric_charge, second, ampere> {};

View File

@ -31,7 +31,7 @@ namespace units {
struct energy : derived_dimension<energy, exp<force, 1>, exp<length, 1>> {};
template<typename T>
concept bool Energy = QuantityOf<T, energy>;
concept Energy = QuantityOf<T, energy>;
struct joule : derived_unit<joule, energy, kilogram, metre, second> {};

View File

@ -31,7 +31,7 @@ namespace units {
struct force : derived_dimension<force, exp<base_dim_mass, 1>, exp<acceleration, 1>> {};
template<typename T>
concept bool Force = QuantityOf<T, force>;
concept Force = QuantityOf<T, force>;
struct newton : derived_unit<newton, force, kilogram, metre, second> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct frequency : derived_dimension<frequency, exp<base_dim_time, -1>> {};
template<typename T>
concept bool Frequency = QuantityOf<T, frequency>;
concept Frequency = QuantityOf<T, frequency>;
struct hertz : derived_unit<hertz, frequency, second> {};
struct millihertz : derived_unit<millihertz, milli<hertz>> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct length : derived_dimension<length, exp<base_dim_length, 1>> {};
template<typename T>
concept bool Length = QuantityOf<T, length>;
concept Length = QuantityOf<T, length>;
// SI units
struct metre : derived_unit<metre, length> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct luminous_intensity : derived_dimension<luminous_intensity, exp<base_dim_luminous_intensity, 1>> {};
template<typename T>
concept bool LuminousIntensity = QuantityOf<T, luminous_intensity>;
concept LuminousIntensity = QuantityOf<T, luminous_intensity>;
struct candela : derived_unit<candela, luminous_intensity> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct mass : derived_dimension<mass, exp<base_dim_mass, 1>> {};
template<typename T>
concept bool Mass = QuantityOf<T, mass>;
concept Mass = QuantityOf<T, mass>;
struct gram : derived_unit<gram, mass, ratio<1, 1000>> {};
struct kilogram : derived_unit<kilogram, kilo<gram>> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct power : derived_dimension<power, exp<energy, 1>, exp<base_dim_time, -1>> {};
template<typename T>
concept bool Power = QuantityOf<T, power>;
concept Power = QuantityOf<T, power>;
struct watt : derived_unit<watt, power, kilogram, metre, second> {};

View File

@ -31,7 +31,7 @@ namespace units {
struct pressure : derived_dimension<pressure, exp<force, 1>, exp<area, -1>> {};
template<typename T>
concept bool Pressure = QuantityOf<T, pressure>;
concept Pressure = QuantityOf<T, pressure>;
struct pascal : derived_unit<pascal, pressure, kilogram, metre, second> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct substance : derived_dimension<substance, exp<base_dim_substance, 1>> {};
template<typename T>
concept bool Substance = QuantityOf<T, substance>;
concept Substance = QuantityOf<T, substance>;
struct mole : derived_unit<mole, substance> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct temperature : derived_dimension<temperature, exp<base_dim_temperature, 1>> {};
template<typename T>
concept bool ThermodynamicTemperature = QuantityOf<T, temperature>;
concept ThermodynamicTemperature = QuantityOf<T, temperature>;
struct kelvin : derived_unit<kelvin, temperature> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct time : derived_dimension<time, exp<base_dim_time, 1>> {};
template<typename T>
concept bool Time = QuantityOf<T, time>;
concept Time = QuantityOf<T, time>;
struct second : derived_unit<second, time> {};
struct nanosecond : derived_unit<nanosecond, nano<second>> {};

View File

@ -30,7 +30,7 @@ namespace units {
struct velocity : derived_dimension<velocity, exp<base_dim_length, 1>, exp<base_dim_time, -1>> {};
template<typename T>
concept bool Velocity = QuantityOf<T, velocity>;
concept Velocity = QuantityOf<T, velocity>;
struct metre_per_second : derived_unit<metre_per_second, velocity, metre, second> {};
struct kilometre_per_hour : derived_unit<kilometre_per_hour, velocity, kilometre, hour> {};

View File

@ -33,7 +33,7 @@ namespace units {
struct voltage : derived_dimension<voltage, exp<power, 1>, exp<base_dim_current, -1>> {};
template<typename T>
concept bool Voltage = QuantityOf<T, voltage>;
concept Voltage = QuantityOf<T, voltage>;
struct volt : derived_unit<volt, voltage, kilogram, metre, second, ampere> {};

View File

@ -29,7 +29,7 @@ namespace units {
struct volume : derived_dimension<volume, exp<base_dim_length, 3>> {};
template<typename T>
concept bool Volume = QuantityOf<T, volume>;
concept Volume = QuantityOf<T, volume>;
struct cubic_millimetre : derived_unit<cubic_millimetre, volume, millimetre> {};
struct cubic_centimetre : derived_unit<cubic_centimetre, volume, centimetre> {};

View File

@ -39,15 +39,15 @@ namespace units {
}
template<typename T>
concept bool Quantity = detail::is_quantity<T>;
concept Quantity = detail::is_quantity<T>;
template<typename T, typename D>
concept bool QuantityOf = Quantity<T> && Dimension<D> && same_dim<typename T::dimension, D>;
concept QuantityOf = Quantity<T> && Dimension<D> && same_dim<typename T::dimension, D>;
// Scalar
template<typename T>
concept bool Scalar = Number<T> && !Quantity<T>;
concept Scalar = Number<T> && !Quantity<T>;
template<Unit U, Scalar Rep>
class quantity;

View File

@ -61,7 +61,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Ratio = detail::is_ratio<T>;
concept Ratio = detail::is_ratio<T>;
// ratio_multiply

View File

@ -48,7 +48,7 @@ namespace units {
}
template<typename T>
concept bool Unit =
concept Unit =
std::is_empty_v<T> &&
detail::is_unit<downcast_base_t<T>>;

View File

@ -56,7 +56,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -56,7 +56,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -56,7 +56,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -49,7 +49,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -37,7 +37,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -79,7 +79,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Exponent = detail::is_exp<T>;
concept Exponent = detail::is_exp<T>;
// exp_dim_id_less
@ -117,7 +117,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Dimension =
concept Dimension =
std::is_empty_v<T> &&
detail::is_dimension<downcast_base_t<T>>;

View File

@ -79,7 +79,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Exponent = detail::is_exp<T>;
concept Exponent = detail::is_exp<T>;
// exp_dim_id_less
@ -117,7 +117,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Dimension =
concept Dimension =
std::is_empty_v<T> &&
detail::is_dimension<downcast_base_t<T>>;

View File

@ -33,7 +33,7 @@ namespace units {
};
template<typename T>
concept bool Downcastable =
concept Downcastable =
requires {
typename T::base_type;
} &&

View File

@ -61,7 +61,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Ratio = detail::is_ratio<T>;
concept Ratio = detail::is_ratio<T>;
// ratio_multiply

View File

@ -61,7 +61,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool Ratio = detail::is_ratio<T>;
concept Ratio = detail::is_ratio<T>;
// ratio_multiply

View File

@ -37,7 +37,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -37,7 +37,7 @@ namespace units {
} // namespace detail
template<typename T>
concept bool TypeList = detail::is_type_list<T>;
concept TypeList = detail::is_type_list<T>;
// push_front

View File

@ -33,7 +33,7 @@ namespace {
struct digital_information : units::derived_dimension<digital_information, units::exp<base_dim_digital_information, 1>> {};
template<typename T>
concept bool DigitalInformation = units::QuantityOf<T, digital_information>;
concept DigitalInformation = units::QuantityOf<T, digital_information>;
struct bit : units::derived_unit<bit, digital_information> {};
struct byte : units::derived_unit<byte, digital_information, units::ratio<8>> {};