Skip to content

Commit dbea551

Browse files
nathanruizdota17
authored andcommitted
Delete nullptr Json::Value constructor (#1194)
This patch adds an explicit ctor with a std::nullptr_t argument, that is `delete`-d. This keeps Json::Value from exposing a coding error when automatically promoted to a const char* type.
1 parent fa1ae11 commit dbea551

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/json/value.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ class JSON_API Value {
354354
Value(const StaticString& value);
355355
Value(const String& value);
356356
Value(bool value);
357+
Value(std::nullptr_t ptr) = delete;
357358
Value(const Value& other);
358359
#if JSONCPP_CXX_STD_11
359360
Value(Value&& other);

0 commit comments

Comments
 (0)