| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
concept IsConstructible = (std::is_constructible_v<Trait, Args> || ...);Nit: constructible_from for consistency
concept IsConstructible = (std::is_constructible_v<Trait, Args> || ...);Not sure about naming; this makes it sound like Trait is constructible from `Args...`
Perhaps
```
template <typename TraitFilter, typename... Args>
concept HasTraitMatching = ...
```
Though we have HasTrait() below, and the difference is subtle.
(count({std::is_constructible_v<Trait, Args>...}, true) <= 1);Nit: constructible_from for consistency
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
concept IsConstructible = (std::is_constructible_v<Trait, Args> || ...);Not sure about naming; this makes it sound like Trait is constructible from `Args...`
Perhaps
```
template <typename TraitFilter, typename... Args>
concept HasTraitMatching = ...
```Though we have HasTrait() below, and the difference is subtle.
I created a HasRequiredEnumTrait concept instead. let me know what you think.
concept IsConstructible = (std::is_constructible_v<Trait, Args> || ...);Patrick MonetteNit: constructible_from for consistency
Done
(count({std::is_constructible_v<Trait, Args>...}, true) <= 1);Patrick MonetteNit: constructible_from for consistency
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM, thanks!
concept IsConstructible = (std::is_constructible_v<Trait, Args> || ...);Patrick MonetteNot sure about naming; this makes it sound like Trait is constructible from `Args...`
Perhaps
```
template <typename TraitFilter, typename... Args>
concept HasTraitMatching = ...
```Though we have HasTrait() below, and the difference is subtle.
I created a HasRequiredEnumTrait concept instead. let me know what you think.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
+Rakina for content/browser PTAL
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[base] Improve traits_bag.h error messages with C++20 concepts
This change refactors base/traits_bag.h to provide clearer diagnostics
when invalid traits are passed to TaskTraits and other trait-based
constructors (e.g., duplicate traits or missing required traits).
It implements a "fallback pattern" using C++20 concepts:
- Constrained overloads are used to handle valid trait combinations.
- Unconstrained overloads are provided as a fallback to trigger a
static_assert with a descriptive error message.
The fallback overloads include a dummy return value to keep the
constexpr function structurally valid. This prevents Clang from emitting
redundant "must be initialized by a constant expression" errors at the
call site after the static_assert fails.
Additionally:
- HasTrait is converted from a struct to a constexpr function template.
- Updated various .nc (no-compile) tests to reflect the cleaner error
output and the removal of redundant diagnostic noise.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |