mirror of
https://github.com/mpusz/mp-units.git
synced 2025-12-18 13:06:44 +01:00
Various cleanup
Some of them were clang-tidy messages, some compiler warnings.
This commit is contained in:
@@ -30,6 +30,7 @@ Checks: '
|
||||
-misc-include-cleaner,
|
||||
-modernize-use-trailing-return-type,
|
||||
-modernize-use-designated-initializers,
|
||||
-portability-avoid-pragma-once,
|
||||
-readability-identifier-length,
|
||||
-readability-isolate-declaration,
|
||||
-readability-magic-numbers,
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(cend()); }
|
||||
constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(cbegin()); }
|
||||
|
||||
[[nodiscard]] constexpr bool empty() const noexcept { return size() == 0; };
|
||||
[[nodiscard]] constexpr bool empty() const noexcept { return size() == 0; }
|
||||
[[nodiscard]] constexpr size_type size() const noexcept { return size_; }
|
||||
[[nodiscard]] static constexpr size_type max_size() noexcept { return N; }
|
||||
[[nodiscard]] static constexpr size_type capacity() noexcept { return N; }
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#ifdef MP_UNITS_IMPORT_STD
|
||||
import std;
|
||||
#else
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <string_view>
|
||||
@@ -69,13 +68,13 @@ struct dimension_interface {
|
||||
template<Dimension Lhs, Dimension Rhs>
|
||||
[[nodiscard]] friend consteval Dimension auto operator*(Lhs, Rhs)
|
||||
{
|
||||
return expr_multiply<derived_dimension, struct dimension_one>(Lhs{}, Rhs{});
|
||||
return expr_multiply<derived_dimension, dimension_one>(Lhs{}, Rhs{});
|
||||
}
|
||||
|
||||
template<Dimension Lhs, Dimension Rhs>
|
||||
[[nodiscard]] friend consteval Dimension auto operator/(Lhs, Rhs)
|
||||
{
|
||||
return expr_divide<derived_dimension, struct dimension_one>(Lhs{}, Rhs{});
|
||||
return expr_divide<derived_dimension, dimension_one>(Lhs{}, Rhs{});
|
||||
}
|
||||
|
||||
template<Dimension Lhs, Dimension Rhs>
|
||||
|
||||
@@ -46,7 +46,6 @@ import std;
|
||||
#include <concepts>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#endif
|
||||
#endif
|
||||
@@ -181,7 +180,7 @@ struct quantity_spec_interface_base {
|
||||
[[nodiscard]] friend consteval QuantitySpec auto operator*(Lhs lhs, Rhs rhs)
|
||||
{
|
||||
return detail::clone_kind_of<Lhs{}, Rhs{}>(
|
||||
detail::expr_multiply<derived_quantity_spec, struct dimensionless, type_list_of_quantity_spec_less>(
|
||||
detail::expr_multiply<derived_quantity_spec, dimensionless, type_list_of_quantity_spec_less>(
|
||||
detail::remove_kind(lhs), detail::remove_kind(rhs)));
|
||||
}
|
||||
|
||||
@@ -189,7 +188,7 @@ struct quantity_spec_interface_base {
|
||||
[[nodiscard]] friend consteval QuantitySpec auto operator/(Lhs lhs, Rhs rhs)
|
||||
{
|
||||
return detail::clone_kind_of<Lhs{}, Rhs{}>(
|
||||
detail::expr_divide<derived_quantity_spec, struct dimensionless, type_list_of_quantity_spec_less>(
|
||||
detail::expr_divide<derived_quantity_spec, dimensionless, type_list_of_quantity_spec_less>(
|
||||
detail::remove_kind(lhs), detail::remove_kind(rhs)));
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ constexpr bool is_basic_literal_character_set_char(char ch)
|
||||
{
|
||||
// https://en.cppreference.com/w/cpp/language/charset
|
||||
return ch == 0x00 || (0x07 <= ch && ch <= 0x0D) || (0x20 <= ch && ch <= 0x7E);
|
||||
};
|
||||
}
|
||||
|
||||
template<typename InputIt>
|
||||
constexpr bool is_basic_literal_character_set(InputIt begin, InputIt end) noexcept
|
||||
|
||||
@@ -161,7 +161,7 @@ template<typename T>
|
||||
return T::exponent;
|
||||
else
|
||||
return ratio{1};
|
||||
};
|
||||
}
|
||||
|
||||
template<SymbolicArg T, ratio R>
|
||||
[[nodiscard]] consteval auto power_or_T_impl()
|
||||
|
||||
@@ -184,7 +184,7 @@ struct unit_interface {
|
||||
template<Unit Lhs, Unit Rhs>
|
||||
[[nodiscard]] friend MP_UNITS_CONSTEVAL Unit auto operator*(Lhs lhs, Rhs rhs)
|
||||
{
|
||||
return expr_multiply<derived_unit, struct one>(lhs, rhs);
|
||||
return expr_multiply<derived_unit, one>(lhs, rhs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,7 +195,7 @@ struct unit_interface {
|
||||
template<Unit Lhs, Unit Rhs>
|
||||
[[nodiscard]] friend MP_UNITS_CONSTEVAL Unit auto operator/(Lhs lhs, Rhs rhs)
|
||||
{
|
||||
return expr_divide<derived_unit, struct one>(lhs, rhs);
|
||||
return expr_divide<derived_unit, one>(lhs, rhs);
|
||||
}
|
||||
|
||||
template<Unit Lhs, Unit Rhs>
|
||||
|
||||
Reference in New Issue
Block a user