From d561e59cacc4e22cb5fb87c3fee09c7c50c7dde2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 7 May 2017 11:13:21 +0200 Subject: meta: add index sequence with types as indices --- compat/meta.hpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'compat') diff --git a/compat/meta.hpp b/compat/meta.hpp index b1c1dd1a..900c515f 100644 --- a/compat/meta.hpp +++ b/compat/meta.hpp @@ -1,6 +1,8 @@ #pragma once +#include #include +#include namespace meta { @@ -29,7 +31,20 @@ namespace detail { { using type = inst; }; -} + + template + struct index_sequence_ + { + using part = std::integral_constant; + using type = typename index_sequence_::type; + }; + + template + struct index_sequence_ + { + using type = std::tuple; + }; +} // ns detail template @@ -50,4 +65,7 @@ using butlast = reverse>>; template using last = lift>; -} +template +using index_sequence = typename detail::index_sequence_::type; + +} // ns meta -- cgit v1.2.3