@@ -199,8 +199,7 @@ class Writer {
199
199
return EndValue (WriteString (str, length));
200
200
}
201
201
202
- template <typename T>
203
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) String(const T* str, SizeType length, bool copy = false ) {
202
+ bool String (const Ch* str, SizeType length, bool copy = false ) {
204
203
RAPIDJSON_ASSERT (str != 0 );
205
204
(void )copy;
206
205
Prefix (kStringType );
@@ -219,8 +218,7 @@ class Writer {
219
218
return WriteStartObject ();
220
219
}
221
220
222
- template <typename T>
223
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) Key(const T* str, SizeType length, bool copy = false ) { return String (str, length, copy); }
221
+ bool Key (const Ch* str, SizeType length, bool copy = false ) { return String (str, length, copy); }
224
222
225
223
bool EndObject (SizeType memberCount = 0 ) {
226
224
(void )memberCount;
@@ -250,23 +248,9 @@ class Writer {
250
248
// @{
251
249
252
250
// ! Simpler but slower overload.
253
- template <typename T>
254
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) String(const T* const & str) { return String (str, internal::StrLen (str)); }
255
- template <typename T>
256
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) Key(const T* const & str) { return Key (str, internal::StrLen (str)); }
251
+ bool String (const Ch* const & str) { return String (str, internal::StrLen (str)); }
252
+ bool Key (const Ch* const & str) { return Key (str, internal::StrLen (str)); }
257
253
258
- // ! The compiler can give us the length of quoted strings for free.
259
- template <typename T, size_t N>
260
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) String(const T (&str)[N]) {
261
- RAPIDJSON_ASSERT (str[N-1 ] == ' \0 ' ); // you must pass in a null-terminated string (quoted constant strings are always null-terminated)
262
- return String (str, N-1 );
263
- }
264
- template <typename T, size_t N>
265
- RAPIDJSON_ENABLEIF_RETURN ((internal::IsSame<Ch, T>), (bool )) Key(const T (&str)[N]) {
266
- RAPIDJSON_ASSERT (str[N-1 ] == ' \0 ' ); // you must pass in a null-terminated string (quoted constant strings are always null-terminated)
267
- return Key (str, N-1 );
268
- }
269
-
270
254
// @}
271
255
272
256
// ! Write a raw JSON value.
0 commit comments