/** * @brief Get the length of the tuple. */ template struct Length { ... }; ... /** * @brief Get the type of the N-th element of the tuple. */ template struct ElementType { typedef typename ElementType::Type Type; }; template struct ElementType<0,Tuple> { typedef typename Tuple::Type1 Type; typedef typename Tuple::Type2 Type2; }; template struct ElementType > { /** * @brief The type of the N-th element of the tuple. */ typedef typename ElementType::Type Type; }; /** * @brief Get the type of the first element of the tuple. */ template struct ElementType<0, Pair > { /** * @brief The type of the first element of the tuple. */ typedef T1 Type; }; /** * @brief Get the N-th element of a tuple. */ template struct Element { ... }; ...