]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/json/detail/array.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / json / detail / array.hpp
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_DETAIL_ARRAY_HPP
11 #define BOOST_JSON_DETAIL_ARRAY_HPP
12
13 #include <boost/json/detail/config.hpp>
14 #include <boost/json/storage_ptr.hpp>
15 #include <cstddef>
16
17 BOOST_JSON_NS_BEGIN
18
19 class value;
20
21 namespace detail {
22
23 class unchecked_array
24 {
25 value* data_;
26 std::size_t size_;
27 storage_ptr const& sp_;
28
29 public:
30 inline
31 ~unchecked_array();
32
33 unchecked_array(
34 value* data,
35 std::size_t size,
36 storage_ptr const& sp) noexcept
37 : data_(data)
38 , size_(size)
39 , sp_(sp)
40 {
41 }
42
43 unchecked_array(
44 unchecked_array&& other) noexcept
45 : data_(other.data_)
46 , size_(other.size_)
47 , sp_(other.sp_)
48 {
49 other.data_ = nullptr;
50 }
51
52 storage_ptr const&
53 storage() const noexcept
54 {
55 return sp_;
56 }
57
58 std::size_t
59 size() const noexcept
60 {
61 return size_;
62 }
63
64 inline
65 void
66 relocate(value* dest) noexcept;
67 };
68
69 } // detail
70
71 BOOST_JSON_NS_END
72
73 // includes are at the bottom of <boost/json/value.hpp>
74
75 #endif