-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How to use JsonDocuments with std::unique_ptrs? #1678
Comments
Hi @matth-x, I just had a quick glance à ArduinoOcpp and this looks like a fantastic project; I'll add a link on arduinojson.org as soon as I can. Honestly, I don't see the point of wrapping a BTW, I think you might be interested in #1343 for creating composite documents. Best regards, |
Hi Benoît, Amazing, thank you for fixing it so quickly! And yes, I will follow #1343 and see when there will be updates. If you like, I would also write a reference for your website. After having been working with your project for 2 years I have seen more than enough to recommend it. |
By "reference", you mean "testimonial", right? |
Here is what I would like to tell the community about ArduinoJson: ArduinoJson is a good example for great engineering. If you rely heavily on JSON, then ArduinoJson will not only give you the tools to handle data processing efficiently, but it will also be a framework to build better products upon. |
The fix was release in ArduinoJson 6.19.0. |
Hi Benoît,
Thank you for all the work on your library, it's really awesome and helps me a lot with my own library (if you're curious, you can have a look: https://github.com/matth-x/ArduinoOcpp).
As your design allows to build the JSON documents as a composite, I took full advantage of it. To make the memory management still straightforward despite multiple sub-documents per document, I would like to go on using
unique_ptr
s because of its familiar semantics.But the following way of using them seems problematic:
This gives me the following compiler output:
The problem seems to be due to the implementation of the
operator=
in theunique_ptr
triggering a call toswap
which could apply to bothstd::swap
andARDUINOJSON_NAMESPACE::swap
as a consequence of ADL.What is the right way of using JsonDocuments with
unique_ptr
s? Have I mistaken something? Thank you in advance for tips!The text was updated successfully, but these errors were encountered: