| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | namespace boost { | ||
| 14 | namespace json { | ||
| 15 | |||
| 16 | template<class T> | ||
| 17 | value | ||
| 18 | 16539 | value_ref:: | |
| 19 | from_builtin( | ||
| 20 | void const* p, | ||
| 21 | storage_ptr sp) noexcept | ||
| 22 | { | ||
| 23 | return value( | ||
| 24 | *reinterpret_cast< | ||
| 25 | T const*>(p), | ||
| 26 | 16539 | std::move(sp)); | |
| 27 | } | ||
| 28 | |||
| 29 | template<class T> | ||
| 30 | value | ||
| 31 | 16 | value_ref:: | |
| 32 | from_const( | ||
| 33 | void const* p, | ||
| 34 | storage_ptr sp) | ||
| 35 | { | ||
| 36 | return value( | ||
| 37 | *reinterpret_cast< | ||
| 38 | T const*>(p), | ||
| 39 |
1/1✓ Branch 3 taken 9 times.
|
16 | std::move(sp)); |
| 40 | } | ||
| 41 | |||
| 42 | template<class T> | ||
| 43 | value | ||
| 44 | 63 | value_ref:: | |
| 45 | from_rvalue( | ||
| 46 | void* p, | ||
| 47 | storage_ptr sp) | ||
| 48 | { | ||
| 49 | return value( | ||
| 50 | 63 | std::move( | |
| 51 | *reinterpret_cast<T*>(p)), | ||
| 52 |
1/1✓ Branch 3 taken 20 times.
|
126 | std::move(sp)); |
| 53 | } | ||
| 54 | |||
| 55 | } // namespace json | ||
| 56 | } // namespace boost | ||
| 57 | |||
| 58 | #endif | ||
| 59 |