Sometimes, particularly when Microsoft's windows.h is included, min/max
are defined as macros, interfering with use of
std::numeric_limits::min() and the like.
To guard against this, the function name is wrapped in an extra set of
parenthesis, which inhibits function-style macro expansion.
When using a MSBuild-based CMake generator like 'Visual Studio 15 2017
Win64', the doc build was failing with the error 'MSB6001: Invalid
command line switch for "cmd.exe". Illegal characters in path.'
This was due to the dependency on Doxyfile*, which wasn't expanded by
CMake.
The fix is to expand this glob in CMake before specifying the custom
command's dependencies.
Partial fix for https://github.com/miloyip/rapidjson/issues/622
* Safely assert upon passing NULL string without length
(requires usage of RAPIDJSON_ASSERT within an expression)
* Allow using a NULL string together with an explicit length 0
(GenericStringRef, GenericValue::SetString, ...), see #817
* Add GenericValue::SetString(StringRefType, Allocator&) overload
* Add tests for the various cases
* Use safe-bool idiom for boolean conversion to avoid accidental
misuse of ParseResult values (closes#989)
* Add operator!= to support more comparison expressions
(previously silently/erroneously used operator bool)
In the move example, the code uses `contacts` when the diagrams use
`contact` (no 's')
The code in the example:
``` Value contacts(kArrayType);
// adding elements to contacts array.
// ...
o.AddMember("contacts", contacts, d.GetAllocator()); // deep clone contacts (may be with lots of allocations)
// destruct contacts.
```
As reported by @Llerd in #962, the `copyConstStrings` parameter
has not been forwarded recursively to the constructors of
object members and array elements.
Copying the result of an in-situ parsing into another value/document
currently requires that the original buffer - still holding the strings
from the parsing, outlives the destination object as well.
In order to obtain a "full" copy of a GenericValue, this commit adds
an optional flag `copyConstStrings` to `CopyFrom`, which then forces
to take a copy of all embedded strings in the source value.
This solves the problem discussed in #962.