Crunch
A Message Definition Language for Getting Things Right
Loading...
Searching...
No Matches
Crunch::messages::ValidField Concept Reference

Concept checking if a type T is a valid field wrapper instance. More...

#include <crunch_messages.hpp>

Concept definition

template<typename T>
messages::is_array_field_v<std::remove_cvref_t<T>> ||
messages::is_map_field_v<std::remove_cvref_t<T>> ||
(messages::is_field_v<std::remove_cvref_t<T>> &&
Concept for valid element type in Array/Map. Must be a scalar, string, message, array,...
Definition: crunch_field.hpp:266
Concept checking if a type T is a valid field wrapper instance.
Definition: crunch_messages.hpp:58

Detailed Description

Concept checking if a type T is a valid field wrapper instance.

Must be a Crunch::messages::Field or ArrayField. For Field, validate that its inner type is valid. We reuse the ValidElementType concept because all valid Array elements are valid fields.

Note
FieldType is a type exposed by all Crunch top-level field types - Field, ArrayField, and MapField. It is used both in this concept to assert that a field is a valid Crunch field, and by serialization protocols to create compile-time branching logic based on a field's underlying type.