-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix compile error when RAPIDJSON_HAS_STDSTRING=1 #333
Conversation
This PR failed checks. |
Hi Milo, Sorry for that. I'm using rapidjson as header only and I didn't have any This is the user code snippet (failed_at, raw_job, etc. are all defined
On Tue, May 12, 2015 at 8:44 AM, Milo Yip notifications@github.com wrote:
|
I have reproduced the problem in |
Thanks for the follow-up! I'll track. On Tue, May 12, 2015 at 5:50 PM, Milo Yip notifications@github.com wrote:
|
As mentioned in the original pull-request for the current std::string str;
Value strval(str, d.GetAllocator());
d.AddMember("string", strval, d.GetAllocator()); |
Got it! On Wed, May 13, 2015 at 1:35 PM, Philipp A. Hartmann <
|
Fixed in #335 |
This fixes the following error when compiling with RAPIDJSON_HAS_STDSTRING=1.
./rapidjson/include/rapidjson/document.h:992:29: error: no matching function for call to ‘rapidjson::GenericValuerapidjson::UTF8< >::GenericValue(std::basic_string&)’
./rapidjson/include/rapidjson/document.h:992:29: note: candidates are:
./rapidjson/include/rapidjson/document.h:554:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const std::basic_string&, Allocator&) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, typename Encoding::Ch = char]
./rapidjson/include/rapidjson/document.h:554:5: note: candidate expects 2 arguments, 1 provided
./rapidjson/include/rapidjson/document.h:548:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const Ch_, Allocator&) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, rapidjson::GenericValue<Encoding, Allocator>::Ch = char]
./rapidjson/include/rapidjson/document.h:548:5: note: candidate expects 2 arguments, 1 provided
./rapidjson/include/rapidjson/document.h:545:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const Ch_, rapidjson::SizeType, Allocator&) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, rapidjson::GenericValue<Encoding, Allocator>::Ch = char, rapidjson::SizeType = unsigned int]
./rapidjson/include/rapidjson/document.h:545:5: note: candidate expects 3 arguments, 1 provided
./rapidjson/include/rapidjson/document.h:542:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(rapidjson::GenericValue<Encoding, Allocator>::StringRefType) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, rapidjson::GenericValue<Encoding, Allocator>::StringRefType = rapidjson::GenericStringRef, typename Encoding::Ch = char]
./rapidjson/include/rapidjson/document.h:542:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘rapidjson::GenericStringRef’
./rapidjson/include/rapidjson/document.h:539:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const Ch_, rapidjson::SizeType) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, rapidjson::GenericValue<Encoding, Allocator>::Ch = char, rapidjson::SizeType = unsigned int]
./rapidjson/include/rapidjson/document.h:539:5: note: candidate expects 2 arguments, 1 provided
./rapidjson/include/rapidjson/document.h:536:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(double) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>]
./rapidjson/include/rapidjson/document.h:536:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘double’
./rapidjson/include/rapidjson/document.h:525:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(uint64_t) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, uint64_t = long unsigned int]
./rapidjson/include/rapidjson/document.h:525:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘long unsigned int’
./rapidjson/include/rapidjson/document.h:511:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(int64_t) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, int64_t = long int]
./rapidjson/include/rapidjson/document.h:511:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘long int’
./rapidjson/include/rapidjson/document.h:504:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(unsigned int) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>]
./rapidjson/include/rapidjson/document.h:504:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘unsigned int’
./rapidjson/include/rapidjson/document.h:497:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(int) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>]
./rapidjson/include/rapidjson/document.h:497:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘int’
./rapidjson/include/rapidjson/document.h:487:14: note: template rapidjson::GenericValue::GenericValue(T, typename rapidjson::internal::EnableIf<typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (_)(rapidjson::internal::IsSame<T, bool>)>::Type>::Type*)
./rapidjson/include/rapidjson/document.h:477:5: note: template rapidjson::GenericValue::GenericValue(const rapidjson::GenericValue<Encoding, SourceAllocator>&, Allocator&)
./rapidjson/include/rapidjson/document.h:456:14: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(rapidjson::Type) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>]
./rapidjson/include/rapidjson/document.h:456:14: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘rapidjson::Type’
./rapidjson/include/rapidjson/document.h:447:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const rapidjson::GenericValue<Encoding, Allocator>&) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, rapidjson::GenericValue<Encoding, Allocator> = rapidjson::GenericValuerapidjson::UTF8< >]
./rapidjson/include/rapidjson/document.h:447:5: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘const rapidjson::GenericValuerapidjson::UTF8< >&’
./rapidjson/include/rapidjson/document.h:440:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(rapidjson::GenericValue<Encoding, Allocator>&&) [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>, rapidjson::GenericValue<Encoding, Allocator> = rapidjson::GenericValuerapidjson::UTF8< >]
./rapidjson/include/rapidjson/document.h:440:5: note: no known conversion for argument 1 from ‘std::basic_string’ to ‘rapidjson::GenericValuerapidjson::UTF8< >&&’
./rapidjson/include/rapidjson/document.h:436:5: note: rapidjson::GenericValue<Encoding, Allocator>::GenericValue() [with Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>]
./rapidjson/include/rapidjson/document.h:436:5: note: candidate expects 0 arguments, 1 provided