Skip to content

Commit

Permalink
jsonpath jsonpath_expression
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Oct 23, 2023
1 parent 24f3f8e commit d32f163
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/jsoncons_ext/jsonpath/jsonpath_expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2652,11 +2652,11 @@ namespace detail {
return jsonpath_expression<Json>(alloc_set, std::move(resources), std::move(expr));
}

template <class Json>
template <class Json,class JsonReference=const Json&>
auto make_expression_for_update(const typename Json::string_view_type& path,
const jsoncons::jsonpath::custom_functions<Json>& funcs = jsoncons::jsonpath::custom_functions<Json>())
{
using jsonpath_traits_type = jsoncons::jsonpath::detail::jsonpath_traits<Json, Json&>;
using jsonpath_traits_type = jsoncons::jsonpath::detail::jsonpath_traits<Json, JsonReference>;

using value_type = typename jsonpath_traits_type::value_type;
using reference = typename jsonpath_traits_type::reference;
Expand All @@ -2666,7 +2666,7 @@ namespace detail {
evaluator_type evaluator;
auto expr = evaluator.compile(*static_resources, path);

return jsoncons::jsonpath::jsonpath_expression<Json,Json&>(jsoncons::combine_allocators(), std::move(static_resources), std::move(expr));
return jsoncons::jsonpath::jsonpath_expression<value_type,reference>(jsoncons::combine_allocators(), std::move(static_resources), std::move(expr));
}

} // namespace jsonpath
Expand Down

0 comments on commit d32f163

Please sign in to comment.