Commit 8ae2266c authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

GenericStringRef: add NOEXCEPT, add ASSERT

 * constructor from array is RAPIDJSON_NOEXCEPT
 * constructor from plain pointer missed an assert
parent 56625bd9
...@@ -279,7 +279,7 @@ struct GenericStringRef { ...@@ -279,7 +279,7 @@ struct GenericStringRef {
GenericValue instead. GenericValue instead.
*/ */
template<SizeType N> template<SizeType N>
GenericStringRef(const CharType (&str)[N]) GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT
: s(str), length(N-1) {} : s(str), length(N-1) {}
//! Explicitly create string reference from \c const character pointer //! Explicitly create string reference from \c const character pointer
...@@ -302,7 +302,7 @@ struct GenericStringRef { ...@@ -302,7 +302,7 @@ struct GenericStringRef {
GenericValue instead. GenericValue instead.
*/ */
explicit GenericStringRef(const CharType* str) explicit GenericStringRef(const CharType* str)
: s(str), length(internal::StrLen(str)){} : s(str), length(internal::StrLen(str)){ RAPIDJSON_ASSERT(s != NULL); }
//! Create constant string reference from pointer and length //! Create constant string reference from pointer and length
/*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment