♻️ remove "#define private public"

This commit is contained in:
Niels Lohmann committed 2020-08-12 13:30:06 +02:00
1 parent b888afe5f4
commit 9d726c25d5
22 files changed
+59 -36

No files matched your search

@@ -163,7 +163,7 @@ class iter_impl
return *this;
}
private:
JSON_PRIVATE_UNLESS_TESTED:
/*!
@brief set the iterator to the first value
@pre The iterator is initialized; i.e. `m_object != nullptr`.
@@ -627,7 +627,7 @@ class iter_impl
return operator*();
}
private:
JSON_PRIVATE_UNLESS_TESTED:
/// associated JSON instance
pointer m_object = nullptr;
/// the actual iterator of the associated instance
@@ -23,6 +23,7 @@ class primitive_iterator_t
static constexpr difference_type begin_value = 0;
static constexpr difference_type end_value = begin_value + 1;
JSON_PRIVATE_UNLESS_TESTED:
/// iterator as signed integer type
difference_type m_it = (std::numeric_limits<std::ptrdiff_t>::min)();
+4
View File
@@ -375,6 +375,7 @@ class json_pointer
return static_cast<size_type>(res);
}
JSON_PRIVATE_UNLESS_TESTED:
json_pointer top() const
{
if (JSON_HEDLEY_UNLIKELY(empty()))
@@ -387,6 +388,7 @@ class json_pointer
return result;
}
private:
/*!
@brief create and return a reference to the pointed to value
@@ -823,6 +825,7 @@ class json_pointer
{}
}
JSON_PRIVATE_UNLESS_TESTED:
/// escape "~" to "~0" and "/" to "~1"
static std::string escape(std::string s)
{
@@ -838,6 +841,7 @@ class json_pointer
replace_substring(s, "~0", "~");
}
private:
/*!
@param[in] reference_string the reference string to the current value
@param[in] value the value to consider
+7
View File
@@ -83,6 +83,13 @@
#define JSON_ASSERT(x) assert(x)
#endif
// allow to access some private functions (needed by the test suite)
#if defined(JSON_TESTS_PRIVATE)
#define JSON_PRIVATE_UNLESS_TESTED public
#else
#define JSON_PRIVATE_UNLESS_TESTED private
#endif
/*!
@brief macro to briefly define a mapping between an enum and JSON
@def NLOHMANN_JSON_SERIALIZE_ENUM
@@ -14,6 +14,7 @@
#undef JSON_CATCH
#undef JSON_THROW
#undef JSON_TRY
#undef JSON_PRIVATE_UNLESS_TESTED
#undef JSON_HAS_CPP_14
#undef JSON_HAS_CPP_17
#undef NLOHMANN_BASIC_JSON_TPL_DECLARATION
@@ -362,7 +362,7 @@ class serializer
}
}
private:
JSON_PRIVATE_UNLESS_TESTED:
/*!
@brief dump escaped string
@@ -625,6 +625,7 @@ class serializer
}
}
private:
/*!
@brief count digits