AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::val::Items< C > Struct Template Reference

Items constraints. More...

#include <constraints.hpp>

Collaboration diagram for anch::val::Items< C >:

Public Member Functions

template<typename V, typename X>
void apply (const V &items, X &context) const

Public Attributes

std::tuple< C... > constraints

Detailed Description

template<typename... C>
struct anch::val::Items< C >

Items constraints.

Constraints are checked on every item of a collection or every value of a map. Error path contains the item index or the map key.

mapper.registerField("tags", &Pet::tags, anch::val::maxItems(10), anch::val::items(anch::val::minLength(1)));
Template Parameters
Cthe items constraints types
Author
Vincent Lachenal
Since
0.2

Member Function Documentation

◆ apply()

template<typename... C>
template<typename V, typename X>
void anch::val::Items< C >::apply ( const V & items,
X & context ) const

Check every item

Template Parameters
Vthe container type
Xthe context type (see anch::val::CheckContext )
Parameters
itemsthe container
contextthe context (the violation path contains the item index or the map key)
Here is the call graph for this function:

Member Data Documentation

◆ constraints

template<typename... C>
std::tuple<C...> anch::val::Items< C >::constraints

Items constraints


The documentation for this struct was generated from the following file: