mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 06:14:51 +01:00
moved class into "nlohmann" namespace
- fixed issue #9 - also removed std::mutex member variable - also added “std::” prefix to size_t variables
This commit is contained in:
+8
-8
@@ -14,10 +14,12 @@
|
||||
#include <initializer_list> // std::initializer_list
|
||||
#include <iostream> // std::istream, std::ostream
|
||||
#include <map> // std::map
|
||||
#include <mutex> // std::mutex
|
||||
#include <string> // std::string
|
||||
#include <vector> // std::vector
|
||||
|
||||
namespace nlohmann
|
||||
{
|
||||
|
||||
/*!
|
||||
@brief JSON for Modern C++
|
||||
|
||||
@@ -274,7 +276,7 @@ class json
|
||||
const json& at(const char*) const;
|
||||
|
||||
/// return the number of stored values
|
||||
size_t size() const noexcept;
|
||||
std::size_t size() const noexcept;
|
||||
/// checks whether object is empty
|
||||
bool empty() const noexcept;
|
||||
/// removes all elements from compounds and resets values to default
|
||||
@@ -317,10 +319,6 @@ class json
|
||||
/// the payload
|
||||
value value_ {};
|
||||
|
||||
private:
|
||||
/// mutex to guard payload
|
||||
static std::mutex token_;
|
||||
|
||||
public:
|
||||
/// an iterator
|
||||
class iterator
|
||||
@@ -431,9 +429,11 @@ class json
|
||||
/// the current character
|
||||
char current_ {};
|
||||
/// the position inside the input buffer
|
||||
size_t pos_ = 0;
|
||||
std::size_t pos_ = 0;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/// user-defined literal operator to create JSON objects from strings
|
||||
json operator "" _json(const char*, size_t);
|
||||
nlohmann::json operator "" _json(const char*, std::size_t);
|
||||
|
||||
Reference in New Issue
Block a user