// 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_TYPE_LIST_GET_HPP #define EC_META_TYPE_LIST_GET_HPP #include #include "TypeList.hpp" #include "IndexOf.hpp" namespace EC { namespace Meta { template struct TypeListGetHelper { using type = TTypeList; }; template class TTTypeList, unsigned int Index, typename Type, typename... Rest> struct TypeListGetHelper, Index> { using type = typename std::conditional< Index == EC::Meta::IndexOf::value, Type, typename TypeListGetHelper, Index>::type >::type; }; template using TypeListGet = typename TypeListGetHelper::type; } } #endif