diff --git a/CommonLibSF/.clang-format b/CommonLibSF/.clang-format index e7031d45..170ef92e 100644 --- a/CommonLibSF/.clang-format +++ b/CommonLibSF/.clang-format @@ -1,4 +1,4 @@ ---- +--- AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false @@ -54,13 +54,14 @@ ContinuationIndentWidth: 4 Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false -FixNamespaceComments: false +FixNamespaceComments: true IncludeBlocks: Preserve IndentCaseBlocks: true IndentCaseLabels: false IndentExternBlock: Indent IndentGotoLabels: false IndentPPDirectives: AfterHash +IndentRequiresClause: true IndentWidth: 4 IndentWrappedFunctionNames: true KeepEmptyLinesAtTheStartOfBlocks: false @@ -69,6 +70,7 @@ MaxEmptyLinesToKeep: 1 NamespaceIndentation: All PointerAlignment: Left ReflowComments: false +RequiresClausePosition: OwnLine SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false diff --git a/CommonLibSF/include/SFSE/Impl/PCH.h b/CommonLibSF/include/SFSE/Impl/PCH.h index 5ce5dd41..e7e8800e 100644 --- a/CommonLibSF/include/SFSE/Impl/PCH.h +++ b/CommonLibSF/include/SFSE/Impl/PCH.h @@ -1,58 +1,143 @@ #pragma once -#include -#include -#include -#include -#include -#include +/* +++++++++++++++++++++++++ C++23 Standard Library +++++++++++++++++++++++++ */ + +// Concepts library #include + +// Utilities library +#include +#include +#include +#include +#include +#include #include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include #include +#include + +// Dynamic memory management +#include +#include +#include +#include + +// Numeric limits +#include +#include +#include +#include +#include +#include + +// Error handling +#include +#include +#include +#include +#include +#include + +// Strings library +#include +#include +#include +#include +#include +#include +#include +#include + +// Containers library +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +// Iterators library +#include + +// Ranges library +#include + +// Algorithms library +#include +#include + +// Numerics library +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Localization library +#include +#include + +// Input/output library +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Filesystem library +#include + +// Regular Expressions library +#include + +// Atomic Operations library +#include + +// Thread support library +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ + static_assert(std::is_integral_v && sizeof(std::time_t) == sizeof(std::size_t), "wrap std::time_t instead"); #pragma warning(push) @@ -154,15 +239,15 @@ namespace SFSE string(const CharT (&)[N]) -> string; } // namespace nttp - template // - requires(std::invocable>) // + template + requires(std::invocable>) class scope_exit { public: // 1) template - explicit scope_exit(Fn&& a_fn) // - noexcept(std::is_nothrow_constructible_v || std::is_nothrow_constructible_v) // + explicit scope_exit(Fn&& a_fn) // + noexcept(std::is_nothrow_constructible_v || std::is_nothrow_constructible_v) requires(!std::is_same_v, scope_exit> && std::is_constructible_v) { static_assert(std::invocable); @@ -175,8 +260,8 @@ namespace SFSE } // 2) - scope_exit(scope_exit&& a_rhs) // - noexcept(std::is_nothrow_move_constructible_v || std::is_nothrow_copy_constructible_v) // + scope_exit(scope_exit&& a_rhs) // + noexcept(std::is_nothrow_move_constructible_v || std::is_nothrow_copy_constructible_v) requires(std::is_nothrow_move_constructible_v || std::is_copy_constructible_v) { static_assert(!(std::is_nothrow_move_constructible_v && !std::is_move_constructible_v)); @@ -235,7 +320,7 @@ namespace SFSE {} template - constexpr enumeration(Args... a_values) noexcept // + constexpr enumeration(Args... a_values) noexcept requires(std::same_as && ...) : _impl((static_cast(a_values) | ...)) @@ -267,7 +352,7 @@ namespace SFSE [[nodiscard]] constexpr underlying_type underlying() const noexcept { return _impl; } template - constexpr enumeration& set(Args... a_args) noexcept // + constexpr enumeration& set(Args... a_args) noexcept requires(std::same_as && ...) { _impl |= (static_cast(a_args) | ...); @@ -275,7 +360,7 @@ namespace SFSE } template - constexpr enumeration& reset(Args... a_args) noexcept // + constexpr enumeration& reset(Args... a_args) noexcept requires(std::same_as && ...) { _impl &= ~(static_cast(a_args) | ...); @@ -283,21 +368,21 @@ namespace SFSE } template - [[nodiscard]] constexpr bool any(Args... a_args) const noexcept // + [[nodiscard]] constexpr bool any(Args... a_args) const noexcept requires(std::same_as && ...) { return (_impl & (static_cast(a_args) | ...)) != static_cast(0); } template - [[nodiscard]] constexpr bool all(Args... a_args) const noexcept // + [[nodiscard]] constexpr bool all(Args... a_args) const noexcept requires(std::same_as && ...) { return (_impl & (static_cast(a_args) | ...)) == (static_cast(a_args) | ...); } template - [[nodiscard]] constexpr bool none(Args... a_args) const noexcept // + [[nodiscard]] constexpr bool none(Args... a_args) const noexcept requires(std::same_as && ...) { return (_impl & (static_cast(a_args) | ...)) == static_cast(0); @@ -503,7 +588,7 @@ namespace SFSE } template - [[nodiscard]] inline auto pun_bits(Args... a_args) // + [[nodiscard]] inline auto pun_bits(Args... a_args) requires(std::same_as, bool> && ...) { constexpr auto ARGC = sizeof...(Args); @@ -611,7 +696,7 @@ namespace SFSE } template - [[nodiscard]] constexpr auto to_underlying(Enum a_val) noexcept // + [[nodiscard]] constexpr auto to_underlying(Enum a_val) noexcept requires(std::is_enum_v) { return static_cast>(a_val);