EntityComponentMetaSystem/src/EC/Meta/Combine.hpp

34 lines
906 B
C++
Raw Normal View History

// This work derives from Vittorio Romeo's code used for cppcon 2015 licensed under the Academic Free License.
// His code is available here: https://github.com/SuperV1234/cppcon2015
#ifndef EC_META_COMBINE_HPP
#define EC_META_COMBINE_HPP
#include "TypeList.hpp"
namespace EC
{
namespace Meta
{
template <typename TTypeListA, typename TTypeListB>
struct CombineHelper
{
using type = TypeList<>;
};
2016-03-14 08:53:57 +00:00
template <template <typename...> class TTypeListA, template <typename...> class TTypeListB, typename... TypesA, typename... TypesB>
struct CombineHelper<TTypeListA<TypesA...>, TTypeListB<TypesB...> >
{
using type = TypeList<TypesA..., TypesB...>;
};
template <typename TTypeListA, typename TTypeListB>
using Combine = typename CombineHelper<TTypeListA, TTypeListB>::type;
}
}
#endif