mirror of
https://github.com/nlohmann/json.git
synced 2026-09-01 05:57:14 +00:00
Fix the SentinelType example on iterator_input_adapter
The comment offered "a C++20 sentinel or counted_iterator" as examples of a SentinelType, but std::counted_iterator is the IteratorType - the sentinel it pairs with is std::default_sentinel_t. #5268 corrected the same wording in the API documentation and left the code comment behind. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -155,8 +155,9 @@ class input_stream_adapter
|
|||||||
|
|
||||||
// General-purpose iterator-based adapter. It might not be as fast as
|
// General-purpose iterator-based adapter. It might not be as fast as
|
||||||
// theoretically possible for some containers, but it is extremely versatile.
|
// theoretically possible for some containers, but it is extremely versatile.
|
||||||
// SentinelType defaults to IteratorType for backward compatibility, but may
|
// SentinelType defaults to IteratorType for backward compatibility, but may be
|
||||||
// be a different type (e.g., a C++20 sentinel or counted_iterator).
|
// a different type, e.g. a C++20 sentinel such as std::default_sentinel_t when
|
||||||
|
// IteratorType is a std::counted_iterator.
|
||||||
template<typename IteratorType, typename SentinelType = IteratorType>
|
template<typename IteratorType, typename SentinelType = IteratorType>
|
||||||
class iterator_input_adapter
|
class iterator_input_adapter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7158,8 +7158,9 @@ class input_stream_adapter
|
|||||||
|
|
||||||
// General-purpose iterator-based adapter. It might not be as fast as
|
// General-purpose iterator-based adapter. It might not be as fast as
|
||||||
// theoretically possible for some containers, but it is extremely versatile.
|
// theoretically possible for some containers, but it is extremely versatile.
|
||||||
// SentinelType defaults to IteratorType for backward compatibility, but may
|
// SentinelType defaults to IteratorType for backward compatibility, but may be
|
||||||
// be a different type (e.g., a C++20 sentinel or counted_iterator).
|
// a different type, e.g. a C++20 sentinel such as std::default_sentinel_t when
|
||||||
|
// IteratorType is a std::counted_iterator.
|
||||||
template<typename IteratorType, typename SentinelType = IteratorType>
|
template<typename IteratorType, typename SentinelType = IteratorType>
|
||||||
class iterator_input_adapter
|
class iterator_input_adapter
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user