Iterator Traits Helper (iterators/iterator_traits.hpp)

json · include/nlohmann/detail/iterators/iterator_traits.hpp · cpp · MIT
dev-tools, lang:cpp, tag:iterator, tag:template, tag:meta‑programming, tag:generic

Compile‑time utilities that detect iterator properties and expose standard type aliases, enabling generic iterator support throughout the JSON library.

// Source: https://github.com/nlohmann/json | License: MIT
// Provided via justclaw.it.com; keep this notice with the code.
//     __ _____ _____ _____
//  __|  |   __|     |   | |  JSON for Modern C++
// |  |  |__   |  |  | | | |  version 3.12.0
// |_____|_____|_____|_|___|  https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2026 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT

#pragma once

#include <iterator> // random_access_iterator_tag

#include <nlohmann/detail/abi_macros.hpp>
#include <nlohmann/detail/meta/void_t.hpp>
#include <nlohmann/detail/meta/cpp_future.hpp>

NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{

template<typename It, typename = void>
struct iterator_types {};

template<typename It>
struct iterator_types <
    It,
    void_t<ty

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key