Skip to content

Commit

Permalink
2.3.2
Browse files Browse the repository at this point in the history
* removed superfluous #include
  • Loading branch information
andrew-gresyk authored Oct 25, 2023
1 parent b488730 commit e230fc5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
VERSION: '11'
}
- {
OS: ubuntu-22.04,
OS: ubuntu-20.04,
CC: clang-12,
CXX: clang++-12
}
Expand Down
4 changes: 2 additions & 2 deletions development/ffsm2/detail/shared/type_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ struct Find<TL_<Ts...>, T> final
}

template <typename TList, typename T>
constexpr Long index () noexcept { return detail::Find<TList, T>::VALUE; }
constexpr Long index () noexcept { return detail::Find<TList, T>::VALUE; }

template <typename TList, typename T>
constexpr bool contains() noexcept { return std::is_base_of<detail::TypeT<T>, TList>::value; }
constexpr bool contains() noexcept { return detail::Find<TList, T>::VALUE != INVALID_LONG; }

// SPECIFIC
//------------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions development/ffsm2/detail/shared/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ template <bool B,
typename TF>
using Conditional = typename ConditionalT<B, TT, TF>::Type;

//------------------------------------------------------------------------------

template <typename, typename>
struct IsSameT final {
static constexpr bool Value = false;
};

template <typename T>
struct IsSameT<T, T> final {
static constexpr bool Value = true;
};

////////////////////////////////////////////////////////////////////////////////

template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion development/ffsm2/detail/structure/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct S_

using Empty = EmptyT<TArgs>;

static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return std::is_base_of<Head, Empty>::value; }
static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return IsSameT<Head, Empty>::Value; }

FFSM2_IF_TYPEINDEX(const std::type_index TYPE = isBare() ? typeid(None) : typeid(Head));

Expand Down
5 changes: 2 additions & 3 deletions development/ffsm2/machine_dev.hpp
Original file line number Diff line number Diff line change
@@ -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
//
Expand Down Expand Up @@ -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)

Expand All @@ -44,7 +44,6 @@
#ifndef FFSM2_DISABLE_TYPEINDEX
#include <typeindex>
#endif
#include <type_traits> // is_base_of<>

#if defined _DEBUG && _MSC_VER
#include <intrin.h> // __debugbreak()
Expand Down
21 changes: 15 additions & 6 deletions include/ffsm2/machine.hpp
Original file line number Diff line number Diff line change
@@ -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
//
Expand Down Expand Up @@ -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)

Expand All @@ -44,7 +44,6 @@
#ifndef FFSM2_DISABLE_TYPEINDEX
#include <typeindex>
#endif
#include <type_traits> // is_base_of<>

#if defined _DEBUG && _MSC_VER
#include <intrin.h> // __debugbreak()
Expand Down Expand Up @@ -353,6 +352,16 @@ template <bool B,
typename TF>
using Conditional = typename ConditionalT<B, TT, TF>::Type;

template <typename, typename>
struct IsSameT final {
static constexpr bool Value = false;
};

template <typename T>
struct IsSameT<T, T> final {
static constexpr bool Value = true;
};

template <typename T>
struct RemoveConstT final {
using Type = T;
Expand Down Expand Up @@ -930,10 +939,10 @@ struct Find<TL_<Ts...>, T> final
}

template <typename TList, typename T>
constexpr Long index () noexcept { return detail::Find<TList, T>::VALUE; }
constexpr Long index () noexcept { return detail::Find<TList, T>::VALUE; }

template <typename TList, typename T>
constexpr bool contains() noexcept { return std::is_base_of<detail::TypeT<T>, TList>::value; }
constexpr bool contains() noexcept { return detail::Find<TList, T>::VALUE != INVALID_LONG; }

}

Expand Down Expand Up @@ -4474,7 +4483,7 @@ struct S_

using Empty = EmptyT<TArgs>;

static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return std::is_base_of<Head, Empty>::value; }
static FFSM2_CONSTEXPR(11) bool isBare() noexcept { return IsSameT<Head, Empty>::Value; }

FFSM2_IF_TYPEINDEX(const std::type_index TYPE = isBare() ? typeid(None) : typeid(Head));

Expand Down

0 comments on commit e230fc5

Please sign in to comment.