Skip to content

Commit

Permalink
make_expression<json>
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 3, 2023
1 parent b388069 commit fe96ada
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/jsoncons_ext/jsonpath/jsonpath_expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@ namespace detail {

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

Expand All @@ -2766,7 +2766,7 @@ namespace detail {
template <class Json, class TempAllocator>
auto make_update_expression(const allocator_set<typename Json::allocator_type,TempAllocator>& alloc_set,
const typename Json::string_view_type& path,
const jsoncons::jsonpath::custom_functions<Json>& funcs, std::error_code& ec)
const jsoncons::jsonpath::custom_functions<typename jsonpath_traits<Json>::value_type>& funcs, std::error_code& ec)
{
using jsonpath_traits_type = jsoncons::jsonpath::jsonpath_traits<Json>;

Expand Down
6 changes: 3 additions & 3 deletions test/jsonpath/src/jsonpath_make_expression_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ TEST_CASE("jsonpath make_expression test")
]
}
)";
#if 0

SECTION("test 1")
{
int count = 0;

const json doc = json::parse(input);

auto expr = jsoncons::jsonpath::make_update_expression<json>("$.books[*]");
auto expr = jsoncons::jsonpath::make_update_expression<const json>("$.books[*]");

auto callback = [&](const jsonpath::json_location<std::string>& /*location*/, const json& book)
{
Expand All @@ -73,7 +73,7 @@ TEST_CASE("jsonpath make_expression test")
CHECK(count == 1);
CHECK_FALSE(doc["books"][3].contains("price"));
}
#endif

SECTION("test 2")
{
int count = 0;
Expand Down

0 comments on commit fe96ada

Please sign in to comment.