forked from mpusz/mp-units
feat: deprecation messages now provide the release version where the deprecation happened
This commit is contained in:
@@ -65,7 +65,7 @@ template<Reference auto R>
|
||||
constexpr point_<MP_UNITS_REMOVE_CONST(decltype(R))> point{};
|
||||
|
||||
template<Reference auto R>
|
||||
[[deprecated("Use `point` instead")]] constexpr point_<MP_UNITS_REMOVE_CONST(decltype(R))> absolute{};
|
||||
[[deprecated("2.5.0: Use `point` instead")]] constexpr point_<MP_UNITS_REMOVE_CONST(decltype(R))> absolute{};
|
||||
|
||||
MP_UNITS_EXPORT_END
|
||||
|
||||
|
||||
@@ -61,19 +61,19 @@ constexpr bool treat_as_floating_point =
|
||||
#endif
|
||||
|
||||
template<typename Rep>
|
||||
[[deprecated("`is_scalar` is no longer necessary and can simply be removed")]]
|
||||
[[deprecated("2.5.0: `is_scalar` is no longer necessary and can simply be removed")]]
|
||||
constexpr bool is_scalar = false;
|
||||
|
||||
template<typename Rep>
|
||||
[[deprecated("`is_complex` is no longer necessary and can simply be removed")]]
|
||||
[[deprecated("2.5.0: `is_complex` is no longer necessary and can simply be removed")]]
|
||||
constexpr bool is_complex = false;
|
||||
|
||||
template<typename Rep>
|
||||
[[deprecated("`is_vector` is no longer necessary and can simply be removed")]]
|
||||
[[deprecated("2.5.0: `is_vector` is no longer necessary and can simply be removed")]]
|
||||
constexpr bool is_vector = false;
|
||||
|
||||
template<typename Rep>
|
||||
[[deprecated("`is_tensor` is no longer necessary and can simply be removed")]]
|
||||
[[deprecated("2.5.0: `is_tensor` is no longer necessary and can simply be removed")]]
|
||||
constexpr bool is_tensor = false;
|
||||
|
||||
/**
|
||||
@@ -121,7 +121,7 @@ struct representation_values {
|
||||
};
|
||||
|
||||
template<typename Rep>
|
||||
using quantity_values [[deprecated("Use `representation_values` instead")]] = representation_values<Rep>;
|
||||
using quantity_values [[deprecated("2.5.0: Use `representation_values` instead")]] = representation_values<Rep>;
|
||||
|
||||
/**
|
||||
* @brief Provides support for external quantity-like types
|
||||
|
||||
@@ -217,7 +217,7 @@ struct dimension_symbol_formatting {
|
||||
// TODO prevents the deprecated usage in implicit copy constructor warning
|
||||
character_set char_set = character_set::default_character_set;
|
||||
#else
|
||||
[[deprecated("Use `char_set` instead")]] character_set encoding = character_set::default_character_set;
|
||||
[[deprecated("2.5.0: Use `char_set` instead")]] character_set encoding = character_set::default_character_set;
|
||||
MP_UNITS_DIAGNOSTIC_PUSH
|
||||
MP_UNITS_DIAGNOSTIC_IGNORE_DEPRECATED
|
||||
character_set char_set = encoding;
|
||||
|
||||
@@ -207,7 +207,7 @@ template<typename FwdRep, Reference R, RepresentationOf<get_quantity_spec(R{})>
|
||||
template<typename FwdRep, Reference R, RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
|
||||
requires detail::OffsetUnit<decltype(get_unit(R{}))>
|
||||
[[deprecated(
|
||||
"References using offset units (e.g., temperatures) should be constructed with the `delta` or `point` "
|
||||
"2.3.0: References using offset units (e.g., temperatures) should be constructed with the `delta` or `point` "
|
||||
"helpers")]] constexpr auto
|
||||
operator*(FwdRep&& lhs, R r)
|
||||
{
|
||||
@@ -217,7 +217,7 @@ operator*(FwdRep&& lhs, R r)
|
||||
template<typename FwdRep, Reference R, RepresentationOf<get_quantity_spec(R{})> Rep = std::remove_cvref_t<FwdRep>>
|
||||
requires detail::OffsetUnit<decltype(get_unit(R{}))>
|
||||
[[deprecated(
|
||||
"References using offset units (e.g., temperatures) should be constructed with the `delta` or `point` "
|
||||
"2.3.0: References using offset units (e.g., temperatures) should be constructed with the `delta` or `point` "
|
||||
"helpers")]] constexpr auto
|
||||
operator/(FwdRep&& lhs, R)
|
||||
{
|
||||
|
||||
@@ -46,14 +46,14 @@ namespace mp_units {
|
||||
// NOLINTNEXTLINE(readability-enum-initial-value)
|
||||
MP_UNITS_EXPORT enum class character_set : std::int8_t {
|
||||
utf8, // µs; m³; L²MT⁻³
|
||||
unicode [[deprecated("Use `utf8` instead")]] = utf8,
|
||||
unicode [[deprecated("2.4.0: Use `utf8` instead")]] = utf8,
|
||||
portable, // us; m^3; L^2MT^-3
|
||||
ascii [[deprecated("Use `portable` instead")]] = portable,
|
||||
ascii [[deprecated("2.4.0: Use `portable` instead")]] = portable,
|
||||
default_character_set = utf8,
|
||||
default_encoding [[deprecated("Use `default_character_set` instead")]] = default_character_set
|
||||
default_encoding [[deprecated("2.5.0: Use `default_character_set` instead")]] = default_character_set
|
||||
};
|
||||
|
||||
using text_encoding [[deprecated("Use `character_set` instead")]] = character_set;
|
||||
using text_encoding [[deprecated("2.5.0: Use `character_set` instead")]] = character_set;
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -137,8 +137,8 @@ public:
|
||||
|
||||
[[nodiscard]] constexpr const auto& utf8() const { return utf8_; }
|
||||
[[nodiscard]] constexpr const auto& portable() const { return portable_; }
|
||||
[[deprecated("Use `utf8()` instead")]] constexpr const auto& unicode() const { return utf8(); }
|
||||
[[deprecated("Use `portable()` instead")]] constexpr const auto& ascii() const { return portable(); }
|
||||
[[deprecated("2.4.0: Use `utf8()` instead")]] constexpr const auto& unicode() const { return utf8(); }
|
||||
[[deprecated("2.4.0: Use `portable()` instead")]] constexpr const auto& ascii() const { return portable(); }
|
||||
|
||||
[[nodiscard]] constexpr bool empty() const
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ struct mag_constant {
|
||||
// `mag()` implementation.
|
||||
|
||||
template<std::intmax_t N>
|
||||
[[deprecated("`known_first_factor` is no longer necessary and can simply be removed")]]
|
||||
[[deprecated("2.5.0: `known_first_factor` is no longer necessary and can simply be removed")]]
|
||||
constexpr std::optional<std::intmax_t>
|
||||
known_first_factor = std::nullopt;
|
||||
|
||||
@@ -96,7 +96,7 @@ inline constexpr struct pi final :
|
||||
} pi;
|
||||
inline constexpr auto π /* U+03C0 GREEK SMALL LETTER PI */ = pi;
|
||||
|
||||
[[deprecated("Use `mag<pi>` instead")]] inline constexpr UnitMagnitude auto mag_pi = mag<pi>;
|
||||
[[deprecated("2.3.0: Use `mag<pi>` instead")]] inline constexpr UnitMagnitude auto mag_pi = mag<pi>;
|
||||
|
||||
MP_UNITS_EXPORT_END
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ struct unit_symbol_formatting {
|
||||
// TODO prevents the deprecated usage in implicit copy constructor warning
|
||||
character_set char_set = character_set::default_character_set;
|
||||
#else
|
||||
[[deprecated("Use `char_set` instead")]] character_set encoding = character_set::default_character_set;
|
||||
[[deprecated("2.5.0: Use `char_set` instead")]] character_set encoding = character_set::default_character_set;
|
||||
MP_UNITS_DIAGNOSTIC_PUSH
|
||||
MP_UNITS_DIAGNOSTIC_IGNORE_DEPRECATED
|
||||
character_set char_set = encoding;
|
||||
|
||||
@@ -320,7 +320,8 @@ template<auto R1, typename Rep1, auto R2, typename Rep2>
|
||||
*/
|
||||
template<Representation Rep, Reference R>
|
||||
requires requires { std::numeric_limits<Rep>::epsilon(); }
|
||||
[[deprecated("Use `std::numeric_limits<Quantity>::epsilon()` instead")]] [[nodiscard]] constexpr quantity<R{}, Rep>
|
||||
[[deprecated(
|
||||
"2.5.0: Use `std::numeric_limits<Quantity>::epsilon()` instead")]] [[nodiscard]] constexpr quantity<R{}, Rep>
|
||||
epsilon(R r) noexcept
|
||||
{
|
||||
return {static_cast<Rep>(std::numeric_limits<Rep>::epsilon()), r};
|
||||
|
||||
Reference in New Issue
Block a user