Un-deprecate removeMember overloads, return void (#693)
* Un-deprecate removeMember overloads, return void
Sometimes we just want to remove something we don't need anymore. Having
to supply a return buffer for the removeMember function to return something
we don't care about is a nuisance. There are removeMember overloads that
don't need a return buffer but they are deprecated. This commit un-deprecates
these overloads and modifies them to return nothing (void) instead of the
object that was removed.
Further discussion: https://github.com/open-source-parsers/jsoncpp/pull/689
WARNING: Changes the return type of the formerly deprecated removeMember
overloads from Value to void. May break existing client code.
* Minor stylistic fixes
Don't explicitly return a void value from a void function. Also, convert
size_t to unsigned in the CZString ctor to avoid a compiler warning.
diff --git a/include/json/value.h b/include/json/value.h
index ae111fb..2e53314 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -521,13 +521,11 @@
/// \pre type() is objectValue or nullValue
/// \post type() is unchanged
/// \deprecated
- JSONCPP_DEPRECATED("")
- Value removeMember(const char* key);
+ void removeMember(const char* key);
/// Same as removeMember(const char*)
/// \param key may contain embedded nulls.
/// \deprecated
- JSONCPP_DEPRECATED("")
- Value removeMember(const JSONCPP_STRING& key);
+ void removeMember(const JSONCPP_STRING& key);
/// Same as removeMember(const char* begin, const char* end, Value* removed),
/// but 'key' is null-terminated.
bool removeMember(const char* key, Value* removed);