MessagePack for C++
cpp11_convert_helper.hpp
Go to the documentation of this file.
1//
2// MessagePack for C++ static resolution routine
3//
4// Copyright (C) 2017 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#ifndef MSGPACK_V1_CPP11_CONVERT_HELPER_HPP
11#define MSGPACK_V1_CPP11_CONVERT_HELPER_HPP
12
13#include <tuple>
14
16
17namespace msgpack {
21namespace type {
22
23template <typename T>
24inline typename std::enable_if<
26>::type
28 t = o.as<T>();
29}
30template <typename T>
31inline typename std::enable_if<
33>::type
35 o.convert(t);
36}
37
38} // namespace type
39
41} // MSGPACK_API_VERSION_NAMESPACE(v1)
43} // namespace msgpack
44
45#endif // MSGPACK_V1_CPP11_CONVERT_HELPER_HPP
std::enable_if< has_as< T >::value >::type convert_helper(msgpack::object const &o, T &t)
Definition: cpp11_convert_helper.hpp:27
Definition: adaptor_base.hpp:15
Definition: object_fwd.hpp:53
static constexpr bool value
Definition: object_fwd.hpp:66
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
msgpack::enable_if<!msgpack::is_array< T >::value &&!msgpack::is_pointer< T >::value, T & >::type convert(T &v) const
Convert the object.
Definition: object.hpp:1076
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition: object.hpp:1126
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66