Subscript operators

Synopses

Declared in <bdljsn_json.h>

Return a modifiable reference to the held array element at index.

Json&
operator[](std::size_t index);

Return a non‐modifiable reference to the held array element at index.

Json const&
operator[](std::size_t index) const;

Return a modifiable reference to the held object's member for key.

Json&
operator[](std::string_view const& key);

Return a non‐modifiable reference to the held object's member for key.

Json const&
operator[](std::string_view const& key) const;

Return Value

  • modifiable reference to the held array element at index

  • a non‐modifiable reference to the element at the specified position

  • modifiable reference to the held object's member for key

Parameters

Name

Description

index

zero‐based element position

key

UTF‐8 member name

Created with MrDocs