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
17namespace boost {
18namespace json {
19
20class value;
21
22namespace detail {
23
24class unchecked_array
25{
26 value* data_;
27 std::size_t size_;
28 storage_ptr const& sp_;
29
30public:
31 inline
32 ~unchecked_array();
33
34 unchecked_array(
35 value* data,
36 std::size_t size,
37 storage_ptr const& sp) noexcept
38 : data_(data)
39 , size_(size)
40 , sp_(sp)
41 {
42 }
43
44 unchecked_array(
45 unchecked_array&& other) noexcept
46 : data_(other.data_)
47 , size_(other.size_)
48 , sp_(other.sp_)
49 {
50 other.data_ = nullptr;
51 }
52
53 storage_ptr const&
54 storage() const noexcept
55 {
56 return sp_;
57 }
58
59 std::size_t
60 size() const noexcept
61 {
62 return size_;
63 }
64
65 inline
66 void
67 relocate(value* dest) noexcept;
68};
69
70} // detail
71
72} // namespace json
73} // namespace boost
74
75// includes are at the bottom of <boost/json/value.hpp>
76
77#endif
78

source code of boost/libs/json/include/boost/json/detail/array.hpp