|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
Compile-time predicate applied to all alternatives in a variant. More...
#include <jh/metax/variant_adt.h>
Compile-time predicate applied to all alternatives in a variant.
This concept verifies that a user-defined metafunction Check succeeds for every alternative type contained in Variant. Two evaluation modes are supported:
Check<T>::value Check<T, Variant, Args...>::value In the wide form, the second template parameter is always the full Variant type. This design ensures that Check can inspect the entire variant structure without requiring users to redundantly pass it. The mechanism short-circuits: if any alternative fails, the overall result is false.
This is how you define your own check concept:
| Check | A metafunction template that exposes a boolean value. |
| Variant | The std::variant whose alternatives are checked. |
| Args | Additional parameters forwarded to wide-form checks. |
Check does not define value, or if value is not convertible to bool, the result is false.