From aef9c292beae2245da35f60fa8c8bd9c52fd248f Mon Sep 17 00:00:00 2001 From: Per Larsson Date: Sat, 22 Jan 2022 11:11:34 +0100 Subject: Format fix. --- zencore/include/zencore/except.h | 2 +- zencore/include/zencore/memory.h | 6 +++-- zencore/include/zencore/string.h | 6 ++--- zencore/include/zencore/zencore.h | 53 +++++++++++++++++++++++++-------------- 4 files changed, 42 insertions(+), 25 deletions(-) (limited to 'zencore/include') diff --git a/zencore/include/zencore/except.h b/zencore/include/zencore/except.h index d714b6ade..c61db5ba9 100644 --- a/zencore/include/zencore/except.h +++ b/zencore/include/zencore/except.h @@ -22,7 +22,7 @@ ZENCORE_API void ThrowSystemException [[noreturn]] (HRESULT hRes, std::string_vi #if defined(__cpp_lib_source_location) ZENCORE_API void ThrowLastErrorImpl [[noreturn]] (std::string_view Message, const std::source_location& Location); -#define ThrowLastError(Message) ThrowLastErrorImpl(Message, std::source_location::current()) +# define ThrowLastError(Message) ThrowLastErrorImpl(Message, std::source_location::current()) #else ZENCORE_API void ThrowLastError [[noreturn]] (std::string_view Message); #endif diff --git a/zencore/include/zencore/memory.h b/zencore/include/zencore/memory.h index 40a3be18c..560fa9ffc 100644 --- a/zencore/include/zencore/memory.h +++ b/zencore/include/zencore/memory.h @@ -15,9 +15,11 @@ namespace zen { #if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L - template concept ContiguousRange = std::ranges::contiguous_range; +template +concept ContiguousRange = std::ranges::contiguous_range; #else - template concept ContiguousRange = true; +template +concept ContiguousRange = true; #endif struct MemoryView; diff --git a/zencore/include/zencore/string.h b/zencore/include/zencore/string.h index 1afacc089..1e8907906 100644 --- a/zencore/include/zencore/string.h +++ b/zencore/include/zencore/string.h @@ -664,9 +664,9 @@ template uint32_t ForEachStrTok(const std::string_view& Str, char Delim, Fn&& Func) { - const char* It = Str.data(); - const char* End = It + Str.length(); - uint32_t Count = 0; + const char* It = Str.data(); + const char* End = It + Str.length(); + uint32_t Count = 0; while (It != End) { diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h index 9f8af8c41..023b237cd 100644 --- a/zencore/include/zencore/zencore.h +++ b/zencore/include/zencore/zencore.h @@ -139,23 +139,38 @@ // of std::integral. Some platforms like Ubuntu and Mac OS are still on 12. #if defined(__cpp_lib_concepts) # include - template concept Integral = std::integral; - template concept SignedIntegral = std::signed_integral; - template concept UnsignedIntegral = std::unsigned_integral; - template concept Invocable = std::invocable; - template concept DerivedFrom = std::derived_from; +template +concept Integral = std::integral; +template +concept SignedIntegral = std::signed_integral; +template +concept UnsignedIntegral = std::unsigned_integral; +template +concept Invocable = std::invocable; +template +concept DerivedFrom = std::derived_from; #else - template concept Integral = std::is_integral_v; - template concept SignedIntegral = Integral && std::is_signed_v; - template concept UnsignedIntegral = Integral && !std::is_signed_v; - template concept Invocable = requires(F&& f, A&&... a) { std::invoke(std::forward(f), std::forward(a)...); }; - template concept DerivedFrom = std::is_base_of_v && std::is_convertible_v; +template +concept Integral = std::is_integral_v; +template +concept SignedIntegral = Integral && std::is_signed_v; +template +concept UnsignedIntegral = Integral && !std::is_signed_v; +template +concept Invocable = requires(F&& f, A&&... a) +{ + std::invoke(std::forward(f), std::forward(a)...); +}; +template +concept DerivedFrom = std::is_base_of_v && std::is_convertible_v; #endif #if defined(__cpp_lib_ranges) - template concept ContiguousRange = std::ranges::contiguous_range; +template +concept ContiguousRange = std::ranges::contiguous_range; #else - template concept ContiguousRange = true; +template +concept ContiguousRange = true; #endif ////////////////////////////////////////////////////////////////////////// @@ -224,13 +239,13 @@ static_assert(sizeof(wchar_t) == 2, "wchar_t is expected to be two bytes in size # define ZEN_DEBUG_SECTION ZEN_CODE_SECTION(".zcold") #endif -namespace zen { - -class AssertException : public std::logic_error +namespace zen { -public: - AssertException(const char* Msg) : std::logic_error(Msg) {} -}; + class AssertException : public std::logic_error + { + public: + AssertException(const char* Msg) : std::logic_error(Msg) {} + }; } // namespace zen @@ -315,7 +330,7 @@ ZENCORE_API void zencore_forcelinktests(); #ifndef ZEN_USE_MIMALLOC # if ZEN_ARCH_ARM64 - // The vcpkg mimalloc port doesn't support Arm targets + // The vcpkg mimalloc port doesn't support Arm targets # define ZEN_USE_MIMALLOC 0 # else # define ZEN_USE_MIMALLOC 1 -- cgit v1.2.3