MessagePack for C++
Toggle main menu visibility
Loading...
Searching...
No Matches
msgpack
v1
adaptor
detail
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
15
#include "
msgpack/object_fwd.hpp
"
16
17
namespace
msgpack
{
19
MSGPACK_API_VERSION_NAMESPACE
(v1) {
21
namespace
type
{
22
23
template
<
typename
T>
24
inline
typename
std::enable_if<
25
has_as<T>::value
26
>::type
27
convert_helper
(
msgpack::object
const
& o, T& t) {
28
t = o.
as
<T>();
29
}
30
template
<
typename
T>
31
inline
typename
std::enable_if<
32
!
has_as<T>::value
33
>
::type
34
convert_helper
(
msgpack::object
const
& o, T& t) {
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
msgpack::type
Definition
array_ref.hpp:24
msgpack::type::convert_helper
std::enable_if< has_as< T >::value >::type convert_helper(msgpack::object const &o, T &t)
Definition
cpp11_convert_helper.hpp:27
msgpack
Definition
adaptor_base.hpp:15
object_fwd.hpp
msgpack::has_as::value
static constexpr bool value
Definition
object_fwd.hpp:66
msgpack::object
Object class that corresponding to MessagePack format object.
Definition
object_fwd.hpp:77
msgpack::object::convert
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
msgpack::object::as
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition
object.hpp:1126
MSGPACK_API_VERSION_NAMESPACE
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition
versioning.hpp:66
Generated by
1.17.0