refactor: Use C++20 'requires' in ActivityResult constructor (#1420)

## Summary

**What is the goal of this PR?**

Replace SFINAE std::enable_if_t with a C++20 `requires` clause for
clearer constraint expression and better compiler diagnostics on
mismatch.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
This commit is contained in:
Zach Nelson
2026-04-07 08:30:52 -05:00
committed by GitHub
parent 1c13331189
commit 11984f8fef

View File

@@ -59,7 +59,8 @@ struct ActivityResult {
explicit ActivityResult() = default; explicit ActivityResult() = default;
template <typename ResultType, typename = std::enable_if_t<std::is_constructible_v<ResultVariant, ResultType&&>>> template <typename ResultType>
requires std::is_constructible_v<ResultVariant, ResultType&&>
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
ActivityResult(ResultType&& result) : data{std::forward<ResultType>(result)} {} ActivityResult(ResultType&& result) : data{std::forward<ResultType>(result)} {}
}; };