Boost logo

Boost :

From: Дмитрий Архипов (grisumbras_at_[hidden])
Date: 2024-06-04 19:25:51


вт, 4 июн. 2024 г. в 17:43, Marshall Clow via Boost <boost_at_[hidden]>:
> As a data point, I use the technique described here (a custom parsing hook) to find duplicate keys when parsing JSON using Python.
>
> https://stackoverflow.com/questions/14902299/json-loads-allows-duplicate-keys-in-a-dictionary-overwriting-the-first-value

You kinda can do this with Boost.JSON using basic_parser with a custom
handler: https://www.boost.org/doc/libs/release/libs/json/doc/html/json/ref/boost__json__basic_parser.html#json.ref.boost__json__basic_parser.handler0

The main issue is that it's not exactly trivial to use currently, as
the default handler is not a part of the public API. If it was, you'd
be able to do this: https://godbolt.org/z/hn6dKzqGM


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk