Closed ergpudb closed 1 year ago
Thanks for raising this, I understand the issue with scoped allocator adaptor, but it requires some thought. It will take a while to look into this.
std::scoped_allocator_adaptor
is now supported in branch PolymorphicAllocator, see #424
This is now on master.
Using a scoped allocator adaptor (i.e. an allocator wrapped with std::scoped_allocator_adaptor) with jsoncons results in compilation errors.
Example:
Not being super familiar with the structure of the code I'm not quite sure where the problem lies; however I suspect that there are situations where the allocator model isn't implemented quite correctly.
(One thing that jumps out at me is that e.g. the basic_json(basic_json&& other, const Allocator&) constructor ignores the allocator parameter, but the provided allocator should be used instead of other's allocator; similarly, the move assignment operator should either move the source's allocator or not depending on propagate_on_container_move_assignment. These may or may not be related to scoped allocator adaptor failing, but they are ways in which the implementation diverges from the standard model that scoped allocator adaptor relies upon.)
Tested with v0.170.0, C++17, gcc 11.3, x64, Linux.