11template <
typename Value>
class JSONArray {
16 std::vector<Value, typename Value::template Allocator<Value>>;
17 JSONArray() : data{} {}
19 JSONArray(std::initializer_list<Value> values) : data{values} {}
25 return this->data < other.data;
27 auto operator<=(
const JSONArray<Value> &other)
const noexcept ->
bool {
28 return this->data <= other.data;
30 auto operator>(
const JSONArray<Value> &other)
const noexcept ->
bool {
31 return this->data > other.data;
33 auto operator>=(
const JSONArray<Value> &other)
const noexcept ->
bool {
34 return this->data >= other.data;
36 auto operator==(
const JSONArray<Value> &other)
const noexcept ->
bool {
37 return this->data == other.data;
39 auto operator!=(
const JSONArray<Value> &other)
const noexcept ->
bool {
40 return this->data != other.data;
44 using value_type =
typename Container::value_type;
45 using allocator_type =
typename Container::allocator_type;
46 using size_type =
typename Container::size_type;
47 using difference_type =
typename Container::difference_type;
48 using reference =
typename Container::reference;
49 using const_reference =
typename Container::const_reference;
50 using pointer =
typename Container::pointer;
51 using const_pointer =
typename Container::const_pointer;
52 using iterator =
typename Container::iterator;
53 using const_iterator =
typename Container::const_iterator;
54 using reverse_iterator =
typename Container::reverse_iterator;
55 using const_reverse_iterator =
typename Container::const_reverse_iterator;
58 auto begin() noexcept -> iterator {
return this->data.begin(); }
60 auto end() noexcept -> iterator {
return this->data.end(); }
62 [[nodiscard]]
auto begin() const noexcept -> const_iterator {
63 return this->data.begin();
66 [[nodiscard]]
auto end() const noexcept -> const_iterator {
67 return this->data.end();
70 [[nodiscard]]
auto cbegin() const noexcept -> const_iterator {
71 return this->data.cbegin();
74 [[nodiscard]]
auto cend() const noexcept -> const_iterator {
75 return this->data.cend();
78 auto rbegin() noexcept -> reverse_iterator {
return this->data.rbegin(); }
80 auto rend() noexcept -> reverse_iterator {
return this->data.rend(); }
82 [[nodiscard]]
auto rbegin() const noexcept -> const_reverse_iterator {
83 return this->data.rbegin();
86 [[nodiscard]]
auto rend() const noexcept -> const_reverse_iterator {
87 return this->data.rend();
90 [[nodiscard]]
auto crbegin() const noexcept -> const_reverse_iterator {
91 return this->data.crbegin();
94 [[nodiscard]]
auto crend() const noexcept -> const_reverse_iterator {
95 return this->data.crend();
99 [[nodiscard]]
auto size() const noexcept -> size_type {
100 return this->data.size();
104 auto reserve(
const size_type capacity) ->
void {
105 this->data.reserve(capacity);
114#pragma warning(disable : 4251)
118#pragma warning(default : 4251)
std::vector< Value, typename Value::template Allocator< Value > > Container
The underlying container type that holds the array elements.
Definition json_array.h:15