From: Joel Rosdahl Date: Sun, 20 Oct 2024 16:23:14 +0000 (+0200) Subject: refactor: Use C++17-style variable templates X-Git-Tag: v4.11~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d3e7aef010ee40dc92ac8924b68bdebd170be3a;p=thirdparty%2Fccache.git refactor: Use C++17-style variable templates --- diff --git a/src/ccache/inodecache.cpp b/src/ccache/inodecache.cpp index d32c1712..a4771fd8 100644 --- a/src/ccache/inodecache.cpp +++ b/src/ccache/inodecache.cpp @@ -94,7 +94,7 @@ const util::Duration k_fs_space_check_valid_duration(1); static_assert(std::tuple_size() == 20, "Increment version number if size of digest is changed."); -static_assert(std::is_trivially_copyable::value, +static_assert(std::is_trivially_copyable_v, "Digest is expected to be trivially copyable."); static_assert( diff --git a/src/ccache/util/file.cpp b/src/ccache/util/file.cpp index 03f00526..183d04bb 100644 --- a/src/ccache/util/file.cpp +++ b/src/ccache/util/file.cpp @@ -318,7 +318,7 @@ tl::expected read_file(const fs::path& path, size_t size_hint) { const int open_flags = [] { - if constexpr (std::is_same::value) { + if constexpr (std::is_same_v) { return O_RDONLY | O_TEXT; } else { return O_RDONLY | O_BINARY; @@ -376,7 +376,7 @@ read_file(const fs::path& path, size_t size_hint) result.resize(pos); #ifdef _WIN32 - if constexpr (std::is_same::value) { + if constexpr (std::is_same_v) { // Convert to UTF-8 if the content starts with a UTF-16 little-endian BOM. if (has_utf16_le_bom(result)) { result.erase(0, 2); // Remove BOM.