diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-05-06 18:22:44 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-05-06 18:22:44 +0100 |
commit | 69f00c519bd5d59a3860c045172bb8d13ce24db2 (patch) | |
tree | 7d64a99efc30d8661e5fcc4d640a5ae859a7ea8f | |
parent | Remove unused capture (diff) | |
download | netfs-69f00c519bd5d59a3860c045172bb8d13ce24db2.tar.bz2 netfs-69f00c519bd5d59a3860c045172bb8d13ce24db2.tar.xz netfs-69f00c519bd5d59a3860c045172bb8d13ce24db2.zip |
Allow implicit conversion to safe<T>
-rw-r--r-- | netfs/ice/numeric.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/netfs/ice/numeric.h b/netfs/ice/numeric.h index f66b98d..16af1f4 100644 --- a/netfs/ice/numeric.h +++ b/netfs/ice/numeric.h @@ -26,12 +26,13 @@ protected: template<std::integral T> struct safe : safe_base { #ifdef __cpp_lib_source_location - constexpr explicit safe(T v, const std::source_location w = std::source_location::current()) noexcept : - value {v}, where {w} + // cppcheck-suppress noExplicitConstructor; NOLINTNEXTLINE(hicpp-explicit-conversions) + constexpr safe(T v, const std::source_location w = std::source_location::current()) noexcept : value {v}, where {w} { } #else - constexpr explicit safe(T v) noexcept : value {v} { } + // cppcheck-suppress noExplicitConstructor; NOLINTNEXTLINE(hicpp-explicit-conversions) + constexpr safe(T v) noexcept : value {v} { } #endif // NOLINTNEXTLINE(hicpp-explicit-conversions) |