Created nlohmann::basicjson::front (markdown)
1 parent
decb9581be
commit
291cd250cd
1 file changed
+31
@@ -0,0 +1,31 @@
|
|||||||
|
```cpp
|
||||||
|
reference front();
|
||||||
|
const_reference front() const;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
Returns a reference to the first element in the container. Calling `front` on an empty container is undefined.
|
||||||
|
|
||||||
|
For a JSON container `c`, the expression `c.front()` is equivalent to `*c.begin()`.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
## Return value
|
||||||
|
|
||||||
|
Reference to the first element. In cast of number, string, or boolean values, a reference to the value is returned.
|
||||||
|
|
||||||
|
## Complexity
|
||||||
|
|
||||||
|
Constant.
|
||||||
|
|
||||||
|
## Exceptions
|
||||||
|
|
||||||
|
`std::out_of_range` when called on null value.
|
||||||
|
|
||||||
|
## See also
|
||||||
|
|
||||||
|
- [**back**](https://github.com/nlohmann/json/wiki/nlohmann::basicjson::back)<br>
|
||||||
|
access the last element
|
||||||
Reference in new issue
Block a user