diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6a8265d..687d5eb 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -80,7 +80,7 @@ jobs: VERSION: '11' } - { - OS: ubuntu-22.04, + OS: ubuntu-20.04, CC: clang-12, CXX: clang++-12 } diff --git a/development/ffsm2/detail/shared/type_list.hpp b/development/ffsm2/detail/shared/type_list.hpp index 8b5fa91..38c3a3d 100644 --- a/development/ffsm2/detail/shared/type_list.hpp +++ b/development/ffsm2/detail/shared/type_list.hpp @@ -135,10 +135,10 @@ struct Find, T> final } template -constexpr Long index () noexcept { return detail::Find::VALUE; } +constexpr Long index () noexcept { return detail::Find::VALUE; } template -constexpr bool contains() noexcept { return std::is_base_of, TList>::value; } +constexpr bool contains() noexcept { return detail::Find::VALUE != INVALID_LONG; } // SPECIFIC //------------------------------------------------------------------------------ diff --git a/development/ffsm2/detail/shared/utility.hpp b/development/ffsm2/detail/shared/utility.hpp index 643c3b7..48297ec 100644 --- a/development/ffsm2/detail/shared/utility.hpp +++ b/development/ffsm2/detail/shared/utility.hpp @@ -43,6 +43,18 @@ template using Conditional = typename ConditionalT::Type; +//------------------------------------------------------------------------------ + +template +struct IsSameT final { + static constexpr bool Value = false; +}; + +template +struct IsSameT final { + static constexpr bool Value = true; +}; + //////////////////////////////////////////////////////////////////////////////// template diff --git a/development/ffsm2/detail/structure/state.hpp b/development/ffsm2/detail/structure/state.hpp index 9c6ab12..0d0f8ed 100644 --- a/development/ffsm2/detail/structure/state.hpp +++ b/development/ffsm2/detail/structure/state.hpp @@ -92,7 +92,7 @@ struct S_ using Empty = EmptyT; - static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return std::is_base_of::value; } + static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return IsSameT::Value; } FFSM2_IF_TYPEINDEX(const std::type_index TYPE = isBare() ? typeid(None) : typeid(Head)); diff --git a/development/ffsm2/machine_dev.hpp b/development/ffsm2/machine_dev.hpp index cd99ef5..9b1d4f6 100644 --- a/development/ffsm2/machine_dev.hpp +++ b/development/ffsm2/machine_dev.hpp @@ -1,5 +1,5 @@ // FFSM2 (flat state machine for games and interactive applications) -// 2.3.1 (2023-09-23) +// 2.3.2 (2023-10-25) // // Created by Andrew Gresyk // @@ -33,7 +33,7 @@ #define FFSM2_VERSION_MAJOR 2 #define FFSM2_VERSION_MINOR 3 -#define FFSM2_VERSION_PATCH 1 +#define FFSM2_VERSION_PATCH 2 #define FFSM2_VERSION (10000 * FFSM2_VERSION_MAJOR + 100 * FFSM2_VERSION_MINOR + FFSM2_VERSION_PATCH) @@ -44,7 +44,6 @@ #ifndef FFSM2_DISABLE_TYPEINDEX #include #endif -#include // is_base_of<> #if defined _DEBUG && _MSC_VER #include // __debugbreak() diff --git a/include/ffsm2/machine.hpp b/include/ffsm2/machine.hpp index 7901222..b179524 100644 --- a/include/ffsm2/machine.hpp +++ b/include/ffsm2/machine.hpp @@ -1,5 +1,5 @@ // FFSM2 (flat state machine for games and interactive applications) -// 2.3.1 (2023-09-23) +// 2.3.2 (2023-10-25) // // Created by Andrew Gresyk // @@ -33,7 +33,7 @@ #define FFSM2_VERSION_MAJOR 2 #define FFSM2_VERSION_MINOR 3 -#define FFSM2_VERSION_PATCH 1 +#define FFSM2_VERSION_PATCH 2 #define FFSM2_VERSION (10000 * FFSM2_VERSION_MAJOR + 100 * FFSM2_VERSION_MINOR + FFSM2_VERSION_PATCH) @@ -44,7 +44,6 @@ #ifndef FFSM2_DISABLE_TYPEINDEX #include #endif -#include // is_base_of<> #if defined _DEBUG && _MSC_VER #include // __debugbreak() @@ -353,6 +352,16 @@ template using Conditional = typename ConditionalT::Type; +template +struct IsSameT final { + static constexpr bool Value = false; +}; + +template +struct IsSameT final { + static constexpr bool Value = true; +}; + template struct RemoveConstT final { using Type = T; @@ -930,10 +939,10 @@ struct Find, T> final } template -constexpr Long index () noexcept { return detail::Find::VALUE; } +constexpr Long index () noexcept { return detail::Find::VALUE; } template -constexpr bool contains() noexcept { return std::is_base_of, TList>::value; } +constexpr bool contains() noexcept { return detail::Find::VALUE != INVALID_LONG; } } @@ -4474,7 +4483,7 @@ struct S_ using Empty = EmptyT; - static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return std::is_base_of::value; } + static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return IsSameT::Value; } FFSM2_IF_TYPEINDEX(const std::type_index TYPE = isBare() ? typeid(None) : typeid(Head));