From 8ae2266c3baa40fc2fa1b38244aad6f00cf2c235 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Sun, 31 Aug 2014 22:01:57 +0200 Subject: [PATCH] GenericStringRef: add NOEXCEPT, add ASSERT * constructor from array is RAPIDJSON_NOEXCEPT * constructor from plain pointer missed an assert --- include/rapidjson/document.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 4bdb60f..d139ea7 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -279,7 +279,7 @@ struct GenericStringRef { GenericValue instead. */ template - GenericStringRef(const CharType (&str)[N]) + GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT : s(str), length(N-1) {} //! Explicitly create string reference from \c const character pointer @@ -302,7 +302,7 @@ struct GenericStringRef { GenericValue instead. */ 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 /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue