From 7db167afd191c73350ac37f14e30ebac90bd9cf1 Mon Sep 17 00:00:00 2001
From: Niels <niels.lohmann@gmail.com>
Date: Wed, 1 Apr 2015 23:23:36 +0200
Subject: [PATCH] documented empty()

---
 docs/empty.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 docs/index.md |  2 +-
 2 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 docs/empty.md

diff --git a/docs/empty.md b/docs/empty.md
new file mode 100644
index 000000000..62f269bee
--- /dev/null
+++ b/docs/empty.md
@@ -0,0 +1,55 @@
+# nlohmann::basic_json::empty
+
+```cpp
+bool empty() const noexcept;
+```
+
+Checks if the container has no elements; that is, whether `begin() == end()`.
+
+## Parameters
+
+(none)
+
+## Return value
+
+`true` if the container is empty, `false` otherwise. Note that the JSON types string, number, and boolean are never empty, null values are always empty.
+
+## Exceptions
+
+`noexcept` specification: `noexcept`.
+
+## Complexity
+
+Constant (assuming types `ObjectType` and `ArrayType` satisfy the [Container](http://en.cppreference.com/w/cpp/concept/Container) concept).
+
+## Example
+
+The following code uses empty to check if a `json` container contains any elements:
+
+```cpp
+#include <json.hpp>
+#include <iostream>
+  
+int main()
+{
+    nlohman::json numbers;
+    std::cout << "Initially, numbers.empty(): " << numbers.empty() << '\n';
+    
+    numbers.push_back(42);
+    numbers.push_back(13317); 
+    std::cout << "After adding elements, numbers.empty(): " << numbers.empty() << '\n';
+}
+```
+
+### Output
+
+    Initially, numbers.empty(): 1
+    After adding elements, numbers.empty(): 0
+
+## Requirements
+
+The `empty` member function is part of the [Container](http://en.cppreference.com/w/cpp/concept/Container) requirement.
+
+## See also
+
+- `size()`
diff --git a/docs/index.md b/docs/index.md
index 577c542f5..e824bd051 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -108,7 +108,7 @@ using json = basic_json<
 
 ### Capacity
 
-- `empty`
+- [`empty`](empty)
 - `size`
 - `max_size`
 
-- 
2.26.2