morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::EngageableField Concept Reference

Broader than EmptyCapableField: also covers a plain std::optional<T> member (e.g. std::optional<std::string> email), which does not satisfy EmptyCapableField — it exposes has_value(), not hasValue() (see forms.md's allRequiredEngaged "two exclusions" note). The cross-field rule vocabulary's engagement checks (engaged, notEngaged, requiredWhen, and the membership rules exactlyOneOf/atLeastOneOf/mutuallyExclusive) accept either kind of field, since docs/spec/forms/forms.md's worked example ranges an exactlyOneOf over two plain std::optional<std::string> fields. More...

#include <forms.hpp>

Concept definition

template<typename T>
concept EngageableField = EmptyCapableField<T> || detail::isStdOptional<T>
Concept: a field type with an internal empty state (Quantity, Choice, Timestamp, or any user type exp...
Definition forms.hpp:431
Broader than EmptyCapableField: also covers a plain std::optional<T> member (e.g. std::optional<std::...
Definition forms.hpp:871

Detailed Description

Broader than EmptyCapableField: also covers a plain std::optional<T> member (e.g. std::optional<std::string> email), which does not satisfy EmptyCapableField — it exposes has_value(), not hasValue() (see forms.md's allRequiredEngaged "two exclusions" note). The cross-field rule vocabulary's engagement checks (engaged, notEngaged, requiredWhen, and the membership rules exactlyOneOf/atLeastOneOf/mutuallyExclusive) accept either kind of field, since docs/spec/forms/forms.md's worked example ranges an exactlyOneOf over two plain std::optional<std::string> fields.

Definition at line 871 of file forms.hpp.