refactor 'constexpr const'->'constexpr'

This commit is contained in:
2025-04-29 14:45:17 -05:00
parent a09fd441d3
commit d86e40ab15
102 changed files with 364 additions and 381 deletions

View File

@ -75,7 +75,7 @@ template <typename val_t>
-> bool {
REPERTORY_USES_FUNCTION_NAME();
static constexpr const auto base16{16};
static constexpr auto base16{16};
try {
val.clear();
@ -158,7 +158,7 @@ template <typename col_t>
inline auto to_hex_string(const col_t &collection) -> std::string {
static_assert(sizeof(typename col_t::value_type) == 1U,
"value_type must be 1 byte in size");
static constexpr const auto mask = 0xFF;
static constexpr auto mask{0xFF};
std::stringstream stream{};
for (auto &&val : collection) {

View File

@ -429,14 +429,14 @@ using unique_recur_mutex_lock = std::unique_lock<std::recursive_mutex>;
#if defined(_WIN32)
#if defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
inline constexpr const auto max_path_length = std::size_t{32767U};
inline constexpr auto max_path_length = std::size_t{32767U};
#else // !defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
inline constexpr const auto max_path_length = std::size_t{MAX_PATH};
inline constexpr auto max_path_length = std::size_t{MAX_PATH};
#endif // defined(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
using native_handle = HANDLE;
#else // !defined(_WIN32)
inline constexpr const auto max_path_length = std::size_t{PATH_MAX};
inline constexpr auto max_path_length = std::size_t{PATH_MAX};
using native_handle = int;
#if !defined(INVALID_HANDLE_VALUE)
#define INVALID_HANDLE_VALUE (-1)
@ -482,7 +482,7 @@ using http_ranges = std::vector<http_range>;
#endif // defined(__cplusplus)
#define REPERTORY_USES_FUNCTION_NAME() \
static constexpr const std::string_view function_name { \
static constexpr std::string_view function_name { \
static_cast<const char *>(__FUNCTION__), \
}

View File

@ -29,7 +29,7 @@
#include "utils/hash.hpp"
namespace repertory::utils::encryption {
inline constexpr const std::uint32_t encryption_header_size{
inline constexpr std::uint32_t encryption_header_size{
crypto_aead_xchacha20poly1305_IETF_NPUBBYTES +
crypto_aead_xchacha20poly1305_IETF_ABYTES,
};

View File

@ -26,30 +26,30 @@
#include "utils/string.hpp"
namespace repertory::utils::path {
inline constexpr const std::string_view backslash{"\\"};
inline constexpr const std::wstring_view backslash_w{L"\\"};
inline constexpr const std::string_view dot{"."};
inline constexpr const std::wstring_view dot_w{L"."};
inline constexpr const std::string_view dot_backslash{".\\"};
inline constexpr const std::wstring_view dot_backslash_w{L".\\"};
inline constexpr const std::string_view dot_slash{"./"};
inline constexpr const std::wstring_view dot_slash_w{L"./"};
inline constexpr const std::string_view long_notation{"\\\\?\\"};
inline constexpr const std::wstring_view long_notation_w{L"\\\\?\\"};
inline constexpr const std::string_view slash{"/"};
inline constexpr const std::wstring_view slash_w{L"/"};
inline constexpr std::string_view backslash{"\\"};
inline constexpr std::wstring_view backslash_w{L"\\"};
inline constexpr std::string_view dot{"."};
inline constexpr std::wstring_view dot_w{L"."};
inline constexpr std::string_view dot_backslash{".\\"};
inline constexpr std::wstring_view dot_backslash_w{L".\\"};
inline constexpr std::string_view dot_slash{"./"};
inline constexpr std::wstring_view dot_slash_w{L"./"};
inline constexpr std::string_view long_notation{"\\\\?\\"};
inline constexpr std::wstring_view long_notation_w{L"\\\\?\\"};
inline constexpr std::string_view slash{"/"};
inline constexpr std::wstring_view slash_w{L"/"};
#if defined(_WIN32)
inline constexpr const std::string_view directory_seperator{backslash};
inline constexpr const std::wstring_view directory_seperator_w{backslash_w};
inline constexpr const std::string_view not_directory_seperator{slash};
inline constexpr const std::wstring_view not_directory_seperator_w{slash_w};
inline constexpr const std::string_view unc_notation{"\\\\"};
inline constexpr const std::wstring_view unc_notation_w{L"\\\\"};
inline constexpr std::string_view directory_seperator{backslash};
inline constexpr std::wstring_view directory_seperator_w{backslash_w};
inline constexpr std::string_view not_directory_seperator{slash};
inline constexpr std::wstring_view not_directory_seperator_w{slash_w};
inline constexpr std::string_view unc_notation{"\\\\"};
inline constexpr std::wstring_view unc_notation_w{L"\\\\"};
#else // !defined(_WIN32)
inline constexpr const std::string_view directory_seperator{slash};
inline constexpr const std::wstring_view directory_seperator_w{slash_w};
inline constexpr const std::string_view not_directory_seperator{backslash};
inline constexpr const std::wstring_view not_directory_seperator_w{backslash_w};
inline constexpr std::string_view directory_seperator{slash};
inline constexpr std::wstring_view directory_seperator_w{slash_w};
inline constexpr std::string_view not_directory_seperator{backslash};
inline constexpr std::wstring_view not_directory_seperator_w{backslash_w};
#endif // defined(_WIN32)
template <typename char_t>

View File

@ -25,9 +25,9 @@
#include "utils/config.hpp"
namespace repertory::utils::time {
inline constexpr const auto NANOS_PER_SECOND{1000000000ULL};
inline constexpr const auto WIN32_TIME_CONVERSION{116444736000000000ULL};
inline constexpr const auto WIN32_TIME_NANOS_PER_TICK{100ULL};
inline constexpr auto NANOS_PER_SECOND{1000000000ULL};
inline constexpr auto WIN32_TIME_CONVERSION{116444736000000000ULL};
inline constexpr auto WIN32_TIME_NANOS_PER_TICK{100ULL};
#if defined(PROJECT_ENABLE_SPDLOG) || defined(PROJECT_ENABLE_FMT)
[[nodiscard]] inline auto convert_to_utc(time_t time) -> std::time_t {