]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/json/impl/value_ref.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / json / impl / value_ref.hpp
CommitLineData
20effc67
TL
1//
2// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3//
4// Distributed under the Boost Software License, Version 1.0. (See accompanying
5// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6//
7// Official repository: https://github.com/boostorg/json
8//
9
10#ifndef BOOST_JSON_IMPL_VALUE_REF_HPP
11#define BOOST_JSON_IMPL_VALUE_REF_HPP
12
13#include <boost/json/value_from.hpp>
14
15BOOST_JSON_NS_BEGIN
16
17template<class T>
18value
19value_ref::
20from_builtin(
21 void const* p,
22 storage_ptr sp) noexcept
23{
24 return value(
25 *reinterpret_cast<
26 T const*>(p),
27 std::move(sp));
28}
29
30template<class T>
31value
32value_ref::
33from_const(
34 void const* p,
35 storage_ptr sp)
36{
37 return value_from(
38 *reinterpret_cast<
39 T const*>(p),
40 std::move(sp));
41}
42
43template<class T>
44value
45value_ref::
46from_rvalue(
47 void* p,
48 storage_ptr sp)
49{
50 return value_from(
51 std::move(
52 *reinterpret_cast<T*>(p)),
53 std::move(sp));
54}
55
56BOOST_JSON_NS_END
57
58#endif