Created nlohmann::basicjson::front (markdown)

Niels committed 2015-04-12 15:24:53 +02:00
1 parent decb9581be
commit 291cd250cd
1 file changed
+31
+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