Yet more alternative styles

This commit is contained in:
Bradlee Speice 2020-08-30 13:57:07 -04:00
parent a939ceaba7
commit 7fa111a68a

View File

@ -232,6 +232,20 @@ concept ConstMethod =
{ a.unnecessary_const_method() } -> std::same_as<std::uint64_t>;
};
// Can also use parentheses:
/*
template <typename T>
concept ConstMethod = (
requires (const T a) {
{ a.const_method() } -> std::same_as<std::uint64_t>;
} &&
requires (T a) {
{ a.nonconst_method() } -> std::same_as<std::uint64_t>;
{ a.unnecessary_const_method() } -> std::same_as<std::uint64_t>;
}
);
*/
// Formulated inside a `requires` block:
/*
template <typename T>