ALPSCore reference
tuple_traits.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
7 #ifndef ALPSCORE_TUPLE_TRAITS_HPP
8 #define ALPSCORE_TUPLE_TRAITS_HPP
9 
10 #include <tuple>
11 
13 
14 namespace alps {
15  template <size_t Cut, typename... T, size_t... I>
16  auto tuple_tail_(const std::tuple < T... > &t, index_sequence < I... > s) -> DECLTYPE(std::make_tuple(std::get<Cut + I>(t)...));
17 
21  template <size_t Trim, size_t Count, typename T>
22  auto tuple_tail(T &t) -> DECLTYPE(tuple_tail_<Trim>(t, make_index_sequence<Count - Trim>()));
23 
25  template <size_t Trim, typename... T>
26  auto tuple_tail(const std::tuple < T... > &t) -> DECLTYPE(tuple_tail_<Trim>(t, make_index_sequence<std::tuple_size<std::tuple < T... > >::value - Trim>()));
27 
28 }
29 #endif //ALPSCORE_TUPLE_TRAITS_HPP
#define DECLTYPE(ret)
Definition: common.hpp:12
make_integer_sequence< size_t, N > make_index_sequence
auto tuple_tail(T &t) -> DECLTYPE(tuple_tail_< Trim >(t, make_index_sequence< Count-Trim >()))
auto tuple_tail_(const std::tuple< T... > &t, index_sequence< I... > s) -> DECLTYPE(std::make_tuple(std::get< Cut+I >(t)...))