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

Concept: a field type with an internal empty state (Quantity, Choice, Timestamp, or any user type exposing hasValue()). More...

#include <forms.hpp>

Concept definition

template<typename T>
concept EmptyCapableField = requires(const T& field) {
{ field.hasValue() } noexcept -> std::convertible_to<bool>;
}
Concept: a field type with an internal empty state (Quantity, Choice, Timestamp, or any user type exp...
Definition forms.hpp:431

Detailed Description

Concept: a field type with an internal empty state (Quantity, Choice, Timestamp, or any user type exposing hasValue()).

hasValue() must be noexcept: allRequiredEngaged is noexcept and calls it on every member, so a throwing hasValue() would cross a noexcept boundary and call std::terminate. Requiring it here turns that into a compile-time rejection instead — a user field with a throwing hasValue() simply does not satisfy the concept.

Definition at line 431 of file forms.hpp.