Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:02

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/json
0008 //
0009 
0010 #ifndef BOOST_JSON_IMPL_VALUE_REF_HPP
0011 #define BOOST_JSON_IMPL_VALUE_REF_HPP
0012 
0013 namespace boost {
0014 namespace json {
0015 
0016 template<class T>
0017 value
0018 value_ref::
0019 from_builtin(
0020     void const* p,
0021     storage_ptr sp) noexcept
0022 {
0023     return value(
0024         *reinterpret_cast<
0025             T const*>(p),
0026         std::move(sp));
0027 }
0028 
0029 template<class T>
0030 value
0031 value_ref::
0032 from_const(
0033     void const* p,
0034     storage_ptr sp)
0035 {
0036     return value(
0037         *reinterpret_cast<
0038             T const*>(p),
0039         std::move(sp));
0040 }
0041 
0042 template<class T>
0043 value
0044 value_ref::
0045 from_rvalue(
0046     void* p,
0047     storage_ptr sp)
0048 {
0049     return value(
0050         std::move(
0051             *reinterpret_cast<T*>(p)),
0052         std::move(sp));
0053 }
0054 
0055 } // namespace json
0056 } // namespace boost
0057 
0058 #endif