From da258f0ca265f94e8bb6289ffcb2b29ce4102241 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 12 Apr 2015 15:27:18 +0200 Subject: [PATCH] Created nlohmann::basicjson::back (markdown) --- nlohmann::basicjson::back.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 nlohmann::basicjson::back.md diff --git a/nlohmann::basicjson::back.md b/nlohmann::basicjson::back.md new file mode 100644 index 0000000..25a0d12 --- /dev/null +++ b/nlohmann::basicjson::back.md @@ -0,0 +1,31 @@ +```cpp +reference back(); +const_reference back() const; +``` + +## Description + +Returns a reference to the last element in the container. Calling `back` on an empty container is undefined. + +For a JSON container `c`, the expression `return c.back();` is equivalent to `{ auto tmp = c.end(); --tmp; return *tmp; }`. + +## Parameters + +None. + +## Return value + +Reference to the last 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 + +- [**front**](https://github.com/nlohmann/json/wiki/nlohmann::basicjson::front)
+ access the first element \ No newline at end of file