You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
why root_schema be implemented as unique_ptr in json-validator.cpp,could I use it as shared_ptr? #1908
hi! firend, I use original json-validator object in multithread enviroment, but core in second get validator, and I see the source code,find it pass by right value reference and use a unique_ptr,i want to know : why use it as a unique_ptr ? forgive my poor English,thx!
If you want to use the validator in different threads, just do so. When validating a JSON-document the validator-instance and the json-instance are considered const. Nothing is modified. So it is thread-safe.
Activity
nickaein commentedon Jan 19, 2020
I didn't quite understand the problem but you can cast a
unique_ptrtoshared_ptr(example).nlohmann commentedon Jan 19, 2020
Do you mean this project: https://github.com/pboettch/json-schema-validator ?
cc @pboettch
pboettch commentedon Jan 28, 2020
@kelaicai Please open an issue here.
If you want to use the validator in different threads, just do so. When validating a JSON-document the validator-instance and the json-instance are considered
const. Nothing is modified. So it is thread-safe.