From 78a7ecb94672190c117f9e880bbbd692407e74eb Mon Sep 17 00:00:00 2001 From: Jamie Seward Date: Tue, 26 Jul 2016 22:35:46 -0700 Subject: [PATCH] Add std::string overload to PrettyWriter::Key() when RAPIDJSON_HAS_STDSTRING is #defined Only String() has the std::string overload currently. --- include/rapidjson/prettywriter.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/rapidjson/prettywriter.h b/include/rapidjson/prettywriter.h index 75dc474..0dcb0fe 100644 --- a/include/rapidjson/prettywriter.h +++ b/include/rapidjson/prettywriter.h @@ -115,6 +115,12 @@ public: } bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) { + return Key(str.data(), SizeType(str.size())); + } +#endif bool EndObject(SizeType memberCount = 0) { (void)memberCount;