The post_extract function on serialization DSL adapters currently only takes the jsonv::extraction_context and the extracted T. If the post-extract function needs to do something like throw an exception, it is common to want to include the source JSON in the message. Since adapter_builder<T>::adapter_impl::create has access to the source JSON anyway, this should be easy to provide.
adapter_builder<T>::post_extract_func should be changed to std::function<T (const extraction_context&, T&&, const value&)>.
The
post_extract
function on serialization DSL adapters currently only takes thejsonv::extraction_context
and the extractedT
. If the post-extract function needs to do something like throw an exception, it is common to want to include the source JSON in the message. Sinceadapter_builder<T>::adapter_impl::create
has access to the source JSON anyway, this should be easy to provide.adapter_builder<T>::post_extract_func
should be changed tostd::function<T (const extraction_context&, T&&, const value&)>
.