Fixed json_pointer::to_string() failing to compile with custom string type

This commit is contained in:
Tom Lachecki 2023-10-19 00:53:36 +01:00
parent 356489659c
commit 96129bd96d
3 changed files with 5 additions and 2 deletions

View File

@ -71,7 +71,7 @@ class json_pointer
string_t{},
[](const string_t& a, const string_t& b)
{
return detail::concat(a, '/', detail::escape(b));
return detail::concat<string_t>(a, '/', detail::escape(b));
});
}

View File

@ -13755,7 +13755,7 @@ class json_pointer
string_t{},
[](const string_t& a, const string_t& b)
{
return detail::concat(a, '/', detail::escape(b));
return detail::concat<string_t>(a, '/', detail::escape(b));
});
}

View File

@ -346,6 +346,9 @@ TEST_CASE("alternative string type")
CHECK(j.at(alt_json::json_pointer("/foo/0")) == j["foo"][0]);
CHECK(j.at(alt_json::json_pointer("/foo/1")) == j["foo"][1]);
// ensures successful compilation
CHECK(alt_json::json_pointer("/foo/0").to_string() == "/foo/0");
}
SECTION("JSON patch")