cpp11_msgpack_tuple_decl.hpp
Go to the documentation of this file.
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_V1_CPP11_MSGPACK_TUPLE_DECL_HPP
#define MSGPACK_V1_CPP11_MSGPACK_TUPLE_DECL_HPP
#include "msgpack/versioning.hpp"
#include "msgpack/object_fwd.hpp"
#include "msgpack/meta.hpp"
#include <tuple>
namespace msgpack {
MSGPACK_API_VERSION_NAMESPACE(v1) {
namespace type {
// tuple
using std::get;
using std::tuple_size;
using std::tuple_element;
using std::uses_allocator;
using std::ignore;
using std::swap;
template< class... Types >
class tuple : public std::tuple<Types...> {
public:
using base = std::tuple<Types...>;
tuple(tuple const&) = default;
tuple(tuple&&) = default;
template<typename... OtherTypes>
tuple(OtherTypes&&... other):base(std::forward<OtherTypes>(other)...) {}
template<typename... OtherTypes>
tuple(tuple<OtherTypes...> const& other):base(static_cast<std::tuple<OtherTypes...> const&>(other)) {}
template<typename... OtherTypes>
tuple(tuple<OtherTypes...> && other):base(static_cast<std::tuple<OtherTypes...> &&>(other)) {}
tuple& operator=(tuple const&) = default;
tuple& operator=(tuple&&) = default;
template<typename... OtherTypes>
tuple& operator=(tuple<OtherTypes...> const& other) {
*static_cast<base*>(this) = static_cast<std::tuple<OtherTypes...> const&>(other);
return *this;
}
template<typename... OtherTypes>
tuple& operator=(tuple<OtherTypes...> && other) {
*static_cast<base*>(this) = static_cast<std::tuple<OtherTypes...> &&>(other);
return *this;
}
template< std::size_t I>
typename tuple_element<I, base >::type&
get() & { return std::get<I>(*this); }
template< std::size_t I>
typename tuple_element<I, base >::type const&
get() const& { return std::get<I>(*this); }
template< std::size_t I>
typename tuple_element<I, base >::type&&
get() && { return std::get<I>(*this); }
std::size_t size() const { return sizeof...(Types); }
};
template <class... Args>
tuple<Args...> make_tuple(Args&&... args);
template<class... Args>
tuple<Args&&...> forward_as_tuple (Args&&... args) noexcept;
template <class... Tuples>
auto tuple_cat(Tuples&&... args) ->
decltype(
std::tuple_cat(std::forward<typename std::remove_reference<Tuples>::type::base>(args)...)
);
template <class... Args>
tuple<Args&...> tie(Args&... args);
} // namespace type
// --- Pack from tuple to packer stream ---
template <typename Stream, typename Tuple, std::size_t N>
struct MsgpackTuplePacker;
// --- Convert from tuple to object ---
template <typename... Args>
struct MsgpackTupleAs;
template <typename T, typename... Args>
struct MsgpackTupleAsImpl;
template <typename Tuple, std::size_t N>
struct MsgpackTupleConverter;
// --- Convert from tuple to object with zone ---
template <typename Tuple, std::size_t N>
struct MsgpackTupleToObjectWithZone;
} // MSGPACK_API_VERSION_NAMESPACE(v1)
} // namespace msgpack
#endif // MSGPACK_V1_CPP11_MSGPACK_TUPLE_DECL_HPP
msgpack::type::forward_as_tuple
tuple< Args &&... > forward_as_tuple(Args &&... args) noexcept
Definition: cpp11_msgpack_tuple.hpp:31
msgpack::type::tuple_cat
auto tuple_cat(Tuples &&... args) -> decltype(std::tuple_cat(std::forward< typename std::remove_reference< Tuples >::type::base >(args)...))
Definition: cpp11_msgpack_tuple.hpp:36
msgpack::type::tuple::tuple
tuple(tuple const &)=default
meta.hpp
object_fwd.hpp
msgpack::type::tuple_element
Definition: cpp03_msgpack_tuple_decl.hpp:35
msgpack::type::tuple::tuple
tuple(tuple< OtherTypes... > const &other)
Definition: cpp11_msgpack_tuple_decl.hpp:46
msgpack::type::tuple::size
std::size_t size() const
Definition: cpp11_msgpack_tuple_decl.hpp:76
msgpack::type::tuple::operator=
tuple & operator=(tuple< OtherTypes... > &&other)
Definition: cpp11_msgpack_tuple_decl.hpp:59
msgpack
Definition: adaptor_base.hpp:15
versioning.hpp
msgpack::type::tuple::operator=
tuple & operator=(tuple const &)=default
msgpack::MsgpackTupleToObjectWithZone
Definition: cpp11_msgpack_tuple.hpp:172
msgpack::MsgpackTuplePacker
Definition: cpp11_msgpack_tuple.hpp:51
msgpack::type::tuple::base
std::tuple< Types... > base
Definition: cpp11_msgpack_tuple_decl.hpp:37
msgpack::type::tie
tuple< Args &... > tie(Args &... args)
Definition: cpp11_msgpack_tuple.hpp:44
msgpack::type::make_tuple
tuple make_tuple()
Definition: cpp03_msgpack_tuple.hpp:10408
msgpack::type::tuple::operator=
tuple & operator=(tuple< OtherTypes... > const &other)
Definition: cpp11_msgpack_tuple_decl.hpp:54
msgpack::type::tuple::tuple
tuple(tuple< OtherTypes... > &&other)
Definition: cpp11_msgpack_tuple_decl.hpp:48
msgpack::type::tuple::tuple
tuple(OtherTypes &&... other)
Definition: cpp11_msgpack_tuple_decl.hpp:43
msgpack::MsgpackTupleAs
Definition: cpp11_msgpack_tuple.hpp:105
MSGPACK_API_VERSION_NAMESPACE
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
msgpack::type::tuple
Definition: cpp11_msgpack_tuple_decl.hpp:35
msgpack::MsgpackTupleConverter
Definition: cpp11_msgpack_tuple.hpp:119
msgpack::MsgpackTupleAsImpl
Definition: cpp11_msgpack_tuple.hpp:96