We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c45adda commit ceadea5Copy full SHA for ceadea5
cppjson/include/cppjson/object.hpp
@@ -156,6 +156,13 @@ namespace cppjson
156
return Object::ObjectProxy{ this->_objects.emplace_back() };
157
}
158
159
+Object::ObjectProxy EmplaceBack(const auto& object = nullptr)
160
+ {
161
+ if constexpr(std::same_as<decltype(object), std::nullptr_t>)
162
+ return Object::ObjectProxy{ this->_objects.emplace_back() };
163
+ else return Object::ObjectProxy{ this->_objects.emplace_back(object) };
164
+ }
165
+
166
Object::ObjectProxy operator[](const int index)
167
{
168
if (index >= this->_objects.size()) throw std::logic_error("Out of bound");
0 commit comments