style: all files refromatted with clang-format

This commit is contained in:
Mateusz Pusz committed 2022-03-17 23:59:48 +01:00
1 parent cc90985958
commit 144f6951c0
143 files changed
+5845 -3563

No files matched your search

+33 -17
View File
@@ -30,11 +30,11 @@ namespace units {
/**
* @brief Specifies if a value of a type should be treated as a floating-point value
*
*
* This type trait should be specialized for a custom representation type to specify
* that values fo this type should be treated by the library as a floating-point ones
* which will enable implicit conversions between quantities.
*
*
* @tparam Rep a representation type for which a type trait is defined
*/
template<typename Rep>
@@ -46,40 +46,56 @@ inline constexpr bool treat_as_floating_point<T> = treat_as_floating_point<typen
/**
* @brief A type trait that defines zero, one, min, and max for a representation type
*
*
* The zero, one, min, and max member functions in units::quantity forward their work to
* these methods. This type can be specialized if the representation Rep requires a specific
* implementation to return these quantity objects.
*
*
* @tparam Rep a representation type for which a type trait is defined
*/
template<typename Rep>
struct quantity_values {
static constexpr Rep zero() noexcept
requires std::constructible_from<Rep, int>
{ return Rep(0); }
{
return Rep(0);
}
static constexpr Rep one() noexcept
requires std::constructible_from<Rep, int>
{ return Rep(1); }
{
return Rep(1);
}
static constexpr Rep min() noexcept
requires requires { { std::numeric_limits<Rep>::lowest() } -> std::same_as<Rep>; }
{ return std::numeric_limits<Rep>::lowest(); }
requires requires {
{
std::numeric_limits<Rep>::lowest()
} -> std::same_as<Rep>;
}
{
return std::numeric_limits<Rep>::lowest();
}
static constexpr Rep max() noexcept
requires requires { { std::numeric_limits<Rep>::max() } -> std::same_as<Rep>; }
{ return std::numeric_limits<Rep>::max(); }
requires requires {
{
std::numeric_limits<Rep>::max()
} -> std::same_as<Rep>;
}
{
return std::numeric_limits<Rep>::max();
}
};
/**
* @brief Provides support for external quantity-like types
*
*
* The type trait should provide the following nested type aliases: @c dimension, @c unit, @c rep,
* and a static member function @c number(T) that will return the raw value of the quantity.
*
*
* Usage example can be found in @c units/chrono.h header file.
*
*
* @tparam T the type to provide support for
*/
template<typename T>
@@ -87,15 +103,15 @@ struct quantity_like_traits;
/**
* @brief Provides support for external quantity point-like types
*
*
* The type trait should provide the following nested type aliases: @c origin, @c unit, @c rep,
* and a static member function @c relative(T) that will return the quantity-like value of the quantity point.
*
*
* Usage example can be found in @c units/chrono.h header file.
*
*
* @tparam T the type to provide support for
*/
template<typename T>
struct quantity_point_like_traits;
} // namespace units
} // namespace units