Skip to content

Commit 694a005

Browse files
authored
Merge pull request ckormanyos#406 from ckormanyos/simplify_updates
2 parents 620f308 + 9715360 commit 694a005

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

math/wide_integer/uintwide_t.h

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,13 @@
5959

6060
#if (defined(_MSC_VER) && (!defined(__GNUC__) && !defined(__clang__)))
6161
#if (_MSC_VER >= 1900) && defined(_HAS_CXX20) && (_HAS_CXX20 != 0)
62-
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
62+
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
6363
#else
6464
#define WIDE_INTEGER_NODISCARD
6565
#endif
6666
#else
67-
#if (defined(__cplusplus) && (__cplusplus >= 201402L))
68-
#if defined(__AVR__) && (!defined(__GNUC__) || (defined(__GNUC__) && (__cplusplus >= 202002L)))
69-
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
70-
#elif (defined(__cpp_lib_constexpr_algorithms) && (__cpp_lib_constexpr_algorithms >= 201806))
71-
#if defined(__clang__)
72-
#if (__clang_major__ > 9)
73-
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
74-
#else
75-
#define WIDE_INTEGER_NODISCARD
76-
#endif
77-
#else
78-
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
79-
#endif
80-
#elif (defined(__clang__) && (__clang_major__ >= 10)) && (defined(__cplusplus) && (__cplusplus > 201703L))
81-
#if defined(__x86_64__)
82-
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
83-
#else
84-
#define WIDE_INTEGER_NODISCARD
85-
#endif
86-
#else
87-
#define WIDE_INTEGER_NODISCARD
88-
#endif
67+
#if ((defined(__cplusplus) && (__cplusplus >= 201703L)) && (defined(__has_cpp_attribute) && (__has_cpp_attribute(nodiscard) >= 201603L)))
68+
#define WIDE_INTEGER_NODISCARD [[nodiscard]] // NOLINT(cppcoreguidelines-macro-usage)
8969
#else
9070
#define WIDE_INTEGER_NODISCARD
9171
#endif
@@ -2928,12 +2908,6 @@
29282908
return result_min;
29292909
}
29302910

2931-
template<const bool OtherIsSigned>
2932-
static constexpr auto limits_helper_lowest() -> uintwide_t
2933-
{
2934-
return limits_helper_min<OtherIsSigned>();
2935-
}
2936-
29372911
// Write string function.
29382912
template<typename OutputStrIterator>
29392913
constexpr auto wr_string( OutputStrIterator str_result, // NOLINT(readability-function-cognitive-complexity)
@@ -5507,9 +5481,9 @@
55075481
static constexpr int max_exponent = digits;
55085482
static constexpr int max_exponent10 = static_cast<int>((static_cast<std::uintmax_t>(max_exponent) * UINTMAX_C(75257499)) / UINTMAX_C(250000000));
55095483

5510-
static constexpr auto (max) () -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_max <IsSigned>(); }
5511-
static constexpr auto (min) () -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_min <IsSigned>(); }
5512-
static constexpr auto lowest() -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_lowest<IsSigned>(); }
5484+
static constexpr auto (max) () -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_max<IsSigned>(); }
5485+
static constexpr auto (min) () -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_min<IsSigned>(); }
5486+
static constexpr auto lowest() -> local_wide_integer_type { return local_wide_integer_type::template limits_helper_min<IsSigned>(); }
55135487
};
55145488

55155489
template<class T>

0 commit comments

Comments
 (0)