Back to home page

EIC code displayed by LXR

 
 

    


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

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_IMPL_ARRAY_HPP
0011 #define BOOST_JSON_DETAIL_IMPL_ARRAY_HPP
0012 
0013 namespace boost {
0014 namespace json {
0015 namespace detail {
0016 
0017 unchecked_array::
0018 ~unchecked_array()
0019 {
0020     if(! data_ ||
0021         sp_.is_not_shared_and_deallocate_is_trivial())
0022         return;
0023     for(unsigned long i = 0;
0024         i < size_; ++i)
0025         data_[i].~value();
0026 }
0027 
0028 void
0029 unchecked_array::
0030 relocate(value* dest) noexcept
0031 {
0032     if(size_ > 0)
0033         std::memcpy(
0034             static_cast<void*>(dest),
0035             data_, size_ * sizeof(value));
0036     data_ = nullptr;
0037 }
0038 
0039 } // detail
0040 } // namespace json
0041 } // namespace boost
0042 
0043 #endif