diff --git a/_posts/2020-08-05-static-polymorphism.md b/_posts/2020-08-05-static-polymorphism.md index f4ee2dc..557b340 100644 --- a/_posts/2020-08-05-static-polymorphism.md +++ b/_posts/2020-08-05-static-polymorphism.md @@ -232,6 +232,20 @@ concept ConstMethod = { a.unnecessary_const_method() } -> std::same_as; }; +// Can also use parentheses: +/* +template +concept ConstMethod = ( + requires (const T a) { + { a.const_method() } -> std::same_as; + } && + requires (T a) { + { a.nonconst_method() } -> std::same_as; + { a.unnecessary_const_method() } -> std::same_as; + } +); +*/ + // Formulated inside a `requires` block: /* template