messagepack implementation for embedded systems (mbed / arduino)

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers meta.hpp Source File

meta.hpp

00001 //
00002 // MessagePack for C++ static resolution routine
00003 //
00004 // Copyright (C) 2015 KONDO Takatoshi
00005 //
00006 //    Distributed under the Boost Software License, Version 1.0.
00007 //    (See accompanying file LICENSE_1_0.txt or copy at
00008 //    http://www.boost.org/LICENSE_1_0.txt)
00009 //
00010 
00011 #ifndef MSGPACK_META_HPP
00012 #define MSGPACK_META_HPP
00013 
00014 #if !defined(MSGPACK_USE_CPP03)
00015 
00016 #include <type_traits>
00017 
00018 namespace msgpack {
00019 
00020 /// @cond
00021 MSGPACK_API_VERSION_NAMESPACE(v1) {
00022 /// @endcond
00023 
00024 namespace detail {
00025 template<bool...> struct bool_pack;
00026 
00027 template<bool...values> struct all_of_imp
00028     : std::is_same<bool_pack<values..., true>, bool_pack<true, values...>>{};
00029 
00030 } // namespace detail
00031 
00032 template<template <class> class T, class... U>
00033 using all_of = detail::all_of_imp<T<U>::value...>;
00034 
00035 template<std::size_t... Is> struct seq {};
00036 
00037 template<std::size_t N, std::size_t... Is>
00038 struct gen_seq : gen_seq<N-1, N-1, Is...> {};
00039 
00040 template<std::size_t... Is>
00041 struct gen_seq<0, Is...> : seq<Is...> {};
00042 
00043 /// @cond
00044 } // MSGPACK_API_VERSION_NAMESPACE(v1)
00045 /// @endcond
00046 
00047 } // namespace msgpack
00048 
00049 #endif // !defined(MSGPACK_USE_CPP03)
00050 
00051 #endif // MSGPACK_META_HPP