Date: Mon, 10 Aug 2026 17:40:52 +0800 (CST)
Computing via variable templates have slower compilation speed than that of concepts. But concepts only allows `concept bool`(see Concepts TS).
I want concept struct/integrals to be added.
Let Tp be:
a non-closure literal class type with the following properties:
all base classes and non-static data members are public and non-mutable and
the types of all base classes and non-static data members are structural types or (possibly multi-dimensional) array thereof;
an integral type;
an enumeration type.
Then I want `template <...> Tp concept name = ...;` to be valid and works just like a `concept bool`(or `concept` in Standard C++).
Further more, let the conjunction and disjunction of constraints be extended to bit & and bit | operations.
For conjunction, if one bit is 0, then all bits at the same position in the result of later constraint evaluations is ignored (that part is not computed if possible).
For disjunction, if one bit is 1, then all bits at the same position in the result of later constraint evaluations is ignored (that part is not computed if possible).
(That should be another proposal because it's a bit shocking.)
Same functionality but with slower compilation speed:
template <...> inline constexpr Tp name = ...;
If that concept structs and concept integrals (after the earlier `concept bool` in Concept TS) is not so conforming,
then, see my next idea: template final (or `final template`)
I want concept struct/integrals to be added.
Let Tp be:
a non-closure literal class type with the following properties:
all base classes and non-static data members are public and non-mutable and
the types of all base classes and non-static data members are structural types or (possibly multi-dimensional) array thereof;
an integral type;
an enumeration type.
Then I want `template <...> Tp concept name = ...;` to be valid and works just like a `concept bool`(or `concept` in Standard C++).
Further more, let the conjunction and disjunction of constraints be extended to bit & and bit | operations.
For conjunction, if one bit is 0, then all bits at the same position in the result of later constraint evaluations is ignored (that part is not computed if possible).
For disjunction, if one bit is 1, then all bits at the same position in the result of later constraint evaluations is ignored (that part is not computed if possible).
(That should be another proposal because it's a bit shocking.)
Same functionality but with slower compilation speed:
template <...> inline constexpr Tp name = ...;
If that concept structs and concept integrals (after the earlier `concept bool` in Concept TS) is not so conforming,
then, see my next idea: template final (or `final template`)
Received on 2026-08-10 09:40:59
