Skip to content

Commit 54fc6ee

Browse files
^ simplified type_list
1 parent a7d99ed commit 54fc6ee

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

include/hfsm2/detail/shared/type_list.hpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,9 @@ struct ITL_
7979
static constexpr bool contains() { return std::is_base_of<ITL_EntryT<T>, ITL_>::value; }
8080

8181
template <typename T>
82-
static constexpr
83-
typename std::enable_if< std::is_base_of<ITL_EntryT<T>, ITL_>::value, Long>::type
84-
index() {
82+
static constexpr Long index() {
8583
return Base::template select<T>(ITL_{});
8684
}
87-
88-
template <typename T>
89-
static constexpr
90-
typename std::enable_if<!std::is_base_of<ITL_EntryT<T>, ITL_>::value, Long>::type
91-
index() {
92-
return INVALID_LONG;
93-
}
9485
};
9586

9687
////////////////////////////////////////////////////////////////////////////////

include/hfsm2/machine.hpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,18 +2173,9 @@ struct ITL_
21732173
static constexpr bool contains() { return std::is_base_of<ITL_EntryT<T>, ITL_>::value; }
21742174

21752175
template <typename T>
2176-
static constexpr
2177-
typename std::enable_if< std::is_base_of<ITL_EntryT<T>, ITL_>::value, Long>::type
2178-
index() {
2176+
static constexpr Long index() {
21792177
return Base::template select<T>(ITL_{});
21802178
}
2181-
2182-
template <typename T>
2183-
static constexpr
2184-
typename std::enable_if<!std::is_base_of<ITL_EntryT<T>, ITL_>::value, Long>::type
2185-
index() {
2186-
return INVALID_LONG;
2187-
}
21882179
};
21892180

21902181
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)