Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:58

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_DETAIL_ARRAY_HPP
0011 #define BOOST_JSON_DETAIL_ARRAY_HPP
0012 
0013 #include <boost/json/detail/config.hpp>
0014 #include <boost/json/storage_ptr.hpp>
0015 #include <cstddef>
0016 
0017 namespace boost {
0018 namespace json {
0019 
0020 class value;
0021 
0022 namespace detail {
0023 
0024 class unchecked_array
0025 {
0026     value* data_;
0027     std::size_t size_;
0028     storage_ptr const& sp_;
0029 
0030 public:
0031     inline
0032     ~unchecked_array();
0033 
0034     unchecked_array(
0035         value* data,
0036         std::size_t size,
0037         storage_ptr const& sp) noexcept
0038         : data_(data)
0039         , size_(size)
0040         , sp_(sp)
0041     {
0042     }
0043 
0044     unchecked_array(
0045         unchecked_array&& other) noexcept
0046         : data_(other.data_)
0047         , size_(other.size_)
0048         , sp_(other.sp_)
0049     {
0050         other.data_ = nullptr;
0051     }
0052 
0053     storage_ptr const&
0054     storage() const noexcept
0055     {
0056         return sp_;
0057     }
0058 
0059     std::size_t
0060     size() const noexcept
0061     {
0062         return size_;
0063     }
0064 
0065     inline
0066     void
0067     relocate(value* dest) noexcept;
0068 };
0069 
0070 } // detail
0071 
0072 } // namespace json
0073 } // namespace boost
0074 
0075 // includes are at the bottom of <boost/json/value.hpp>
0076 
0077 #endif