nfx-json 1.5.2
Modern C++20 JSON library with schema validation and generation
Loading...
Searching...
No Matches
Concepts.h File Reference

C++20 concepts for JSON type constraints. More...

#include <concepts>
#include <string>
#include <type_traits>
Include dependency graph for Concepts.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nfx::json::is_json_container< T >
 Type trait to identify JSON container types (Object, Array). More...
struct  nfx::json::is_json_container< Document >
 Specialization for Document. More...

Concepts

concept  nfx::json::Primitive
 Concept for JSON-compatible primitive types.
concept  nfx::json::Value
 Concept for all JSON-compatible value types.
concept  nfx::json::Container
 Concept for JSON container types only.
concept  nfx::json::Checkable
 Concept for types that can be checked with is<T>().

Variables

template<typename T>
constexpr bool nfx::json::is_json_container_v = is_json_container<std::decay_t<T>>::value
 Helper variable template.

Detailed Description

C++20 concepts for JSON type constraints.

Defines Primitive concept and type traits infrastructure for type-safe template constraints in the Document API.

Note
Container and Checkable concepts are defined at the end of Document.h after Object and Array are fully defined, since nested class forward declarations don't work with concepts.

Definition in file Concepts.h.

Variable Documentation

◆ is_json_container_v

template<typename T>
bool nfx::json::is_json_container_v = is_json_container<std::decay_t<T>>::value
inlineconstexpr

Helper variable template.

Definition at line 72 of file Concepts.h.