Short version
For certain cases, where copying things is an issue (as the one described below), I would like to favor examples similar to move_only_type over the creation of a from_json function, but specializations of adl_serializer does not seem to work with containers of types for which the specialization exist.
Ideally, I would like to have a "return by value" version of from_json. The STL container of those types would be built by emplacing the values returned by from_json into the container.
Long version / context
We currently use your library (vendoring the json header for now) in xeus, a native C++ implementation of the Jupyter protocol.
In this work, some of the classes that we deserialize from json have a value semantics and implement the RAII pattern. Basically, constructor and destructors amount to acquiring and freeing the resources. Any non-move copy acquires a new version of the resource (with a different id). Move constructor and assignment transfers the resource to the moved-to object.
This is a context in which being able to move things to a container would make a lot of sense...
Short version
For certain cases, where copying things is an issue (as the one described below), I would like to favor examples similar to
move_only_typeover the creation of afrom_jsonfunction, but specializations ofadl_serializerdoes not seem to work with containers of types for which the specialization exist.Ideally, I would like to have a "return by value" version of
from_json. The STL container of those types would be built by emplacing the values returned byfrom_jsoninto the container.Long version / context
We currently use your library (vendoring the json header for now) in xeus, a native C++ implementation of the Jupyter protocol.
In this work, some of the classes that we deserialize from json have a value semantics and implement the RAII pattern. Basically, constructor and destructors amount to acquiring and freeing the resources. Any non-move copy acquires a new version of the resource (with a different id). Move constructor and assignment transfers the resource to the moved-to object.
This is a context in which being able to move things to a container would make a lot of sense...