22 unsigned int ComponentBits::get(
typename std::enable_if<std::is_base_of<Component, T>::value>::type* test) {
23 auto& type =
typeid(T);
25 if (_componentBits.find(type) == _componentBits.end()) {
26 _componentBits[type] = _currentBit++;
29 return _componentBits[type];
32 template <
class... Types>
33 Bitset ComponentBits::getFamilyInternal(
typename std::enable_if<
sizeof...(Types) == 0>::type* test) {
37 template <
class T,
class... Types>
38 Bitset ComponentBits::getFamilyInternal() {
39 Bitset bitset = getFamilyInternal<Types...>();
40 bitset.set(ComponentBits::get<T>());
44 template <
class... Types>
45 unsigned int ComponentBits::getFamily() {
46 return getFamilyInternal<Types...>().getBits();