Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a17a07f0e | ||
|
|
da83aa92c8 | ||
|
|
402af742c0 |
No files matched your search
@@ -1311,6 +1311,8 @@ TEST_CASE("BSON declared document size bounds the content")
|
||||
// records the events that a SAX parser receives
|
||||
struct recorder : nlohmann::json_sax<json>
|
||||
{
|
||||
// GCC's -Weffc++ wants the member initialized in the member initialization list
|
||||
// NOLINTNEXTLINE(readability-redundant-member-init)
|
||||
std::string events {};
|
||||
|
||||
bool null() override
|
||||
|
||||
@@ -54,14 +54,18 @@ int accepts_any(nlohmann::basic_json_view<BasicJsonType, Mode> /*unused*/)
|
||||
return Mode == nlohmann::view_mode::editable ? 3 : 4;
|
||||
}
|
||||
|
||||
template<typename View>
|
||||
auto overload(View v) -> decltype(accepts_editable(v))
|
||||
// overloads that differ only in the mode; deduction ignores the conversion from
|
||||
// read-only to editable views, so each view picks the overload of its own mode
|
||||
// (two templates that differ only in a decltype return type are a redefinition
|
||||
// for MSVC 2015)
|
||||
template<typename BasicJsonType>
|
||||
int overload(nlohmann::basic_json_view<BasicJsonType, nlohmann::view_mode::editable> v)
|
||||
{
|
||||
return accepts_editable(v);
|
||||
}
|
||||
|
||||
template<typename View>
|
||||
auto overload(View v) -> decltype(accepts_read_only(v))
|
||||
template<typename BasicJsonType>
|
||||
int overload(nlohmann::basic_json_view<BasicJsonType, nlohmann::view_mode::read_only> v)
|
||||
{
|
||||
return accepts_read_only(v);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user