boostorg / boostorg/property_tree
write_json fails when using basic_ptree with other string types
- Dominant language
- C++
- Stars
- 65
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
Good morning,
I was working on a project, I would like to use basic_ptree with strings of non standard type (see T1.cpp attached toy example).
While read_json works smootly, write_json fails (see compiler output T1.error.txt).
I checked the code and, apparently, an easy fix could enable this feature (see write.hpp which I revised for your convenience, original lines of code are commented, those inserted are marked with an eol comment "suggested").
Thank you for your time,
Marco.
[write.hpp.txt](https://github.com/boostorg/property_tree/files/4908338/write.hpp.txt)
[T1.cpp.txt](https://github.com/boostorg/property_tree/files/4908339/T1.cpp.txt)
[T1.error.txt](https://github.com/boostorg/property_tree/files/4908340/T1.error.txt)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by compiling the attached T1.cpp with the current write.hpp and compare the failure with the provided T1.error.txt. Trace the write_json path for basic_ptree and non-standard string types, then verify the reported case serializes successfully without breaking the existing read_json behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100