1//
2// MessagePack for C++ static resolution routine
3//
4// Copyright (C) 2015 KONDO Takatoshi
5//
6//    Distributed under the Boost Software License, Version 1.0.
7//    (See accompanying file LICENSE_1_0.txt or copy at
8//    http://www.boost.org/LICENSE_1_0.txt)
9//
10
11#ifndef MSGPACK_META_HPP
12#define MSGPACK_META_HPP
13
14#if !defined(MSGPACK_USE_CPP03)
15
16#include <type_traits>
17
18namespace msgpack {
19
20/// @cond
21MSGPACK_API_VERSION_NAMESPACE(v1) {
22/// @endcond
23
24namespace detail {
25template<bool...> struct bool_pack;
26
27template<bool...values> struct all_of_imp
28    : std::is_same<bool_pack<values..., true>, bool_pack<true, values...>>{};
29
30} // namespace detail
31
32template<template <class> class T, class... U>
33using all_of = detail::all_of_imp<T<U>::value...>;
34
35template<std::size_t... Is> struct seq {};
36
37template<std::size_t N, std::size_t... Is>
38struct gen_seq : gen_seq<N-1, N-1, Is...> {};
39
40template<std::size_t... Is>
41struct gen_seq<0, Is...> : seq<Is...> {};
42
43/// @cond
44} // MSGPACK_API_VERSION_NAMESPACE(v1)
45/// @endcond
46
47} // namespace msgpack
48
49#endif // !defined(MSGPACK_USE_CPP03)
50
51#endif // MSGPACK_META_HPP
52