mirror of
https://github.com/bspeice/speice.io
synced 2024-11-14 22:18:10 -05:00
Yet more alternative styles
This commit is contained in:
parent
a939ceaba7
commit
7fa111a68a
@ -232,6 +232,20 @@ concept ConstMethod =
|
|||||||
{ a.unnecessary_const_method() } -> std::same_as<std::uint64_t>;
|
{ 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:
|
// Formulated inside a `requires` block:
|
||||||
/*
|
/*
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user