@@ -107,8 +107,7 @@ class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding,
107
107
return Base::WriteString (str, length);
108
108
}
109
109
110
- template <typename T>
111
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) String(const T* str, SizeType length, bool copy = false ) {
110
+ bool String (const Ch* str, SizeType length, bool copy = false ) {
112
111
RAPIDJSON_ASSERT (str != 0 );
113
112
(void )copy;
114
113
PrettyPrefix (kStringType );
@@ -127,8 +126,7 @@ class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding,
127
126
return Base::WriteStartObject ();
128
127
}
129
128
130
- template <typename T>
131
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) Key(const T* str, SizeType length, bool copy = false ) { return String (str, length, copy); }
129
+ bool Key (const Ch* str, SizeType length, bool copy = false ) { return String (str, length, copy); }
132
130
133
131
#if RAPIDJSON_HAS_STDSTRING
134
132
bool Key (const std::basic_string<Ch>& str) {
@@ -186,22 +184,8 @@ class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding,
186
184
// @{
187
185
188
186
// ! Simpler but slower overload.
189
- template <typename T>
190
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) String(const T* const & str) { return String (str, internal::StrLen (str)); }
191
- template <typename T>
192
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) Key(const T* const & str) { return Key (str, internal::StrLen (str)); }
193
-
194
- // ! The compiler can give us the length of quoted strings for free.
195
- template <typename T, size_t N>
196
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) String(const T (&str)[N]) {
197
- RAPIDJSON_ASSERT (str[N-1 ] == ' \0 ' ); // you must pass in a null-terminated string (quoted constant strings are always null-terminated)
198
- return String (str, N-1 );
199
- }
200
- template <typename T, size_t N>
201
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) Key(const T (&str)[N]) {
202
- RAPIDJSON_ASSERT (str[N-1 ] == ' \0 ' ); // you must pass in a null-terminated string (quoted constant strings are always null-terminated)
203
- return Key (str, N-1 );
204
- }
187
+ bool String (const Ch* str) { return String (str, internal::StrLen (str)); }
188
+ bool Key (const Ch* str) { return Key (str, internal::StrLen (str)); }
205
189
206
190
// @}
207
191
0 commit comments