From 4a7a0c1c3f8bdbf2779256d42c3c37a951943045 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 18 Mar 2023 21:08:31 +0300 Subject: [PATCH] Fix compound requirement code example (#127) --- CPP20.md | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CPP20.md b/CPP20.md index 61df1fe..c5e8800 100644 --- a/CPP20.md +++ b/CPP20.md @@ -221,9 +221,9 @@ g(baz{}); // PASS. ```c++ template concept C = requires(T x) { - {*x} -> typename T::inner; // the type of the expression `*x` is convertible to `T::inner` + {*x} -> std::convertible_to; // the type of the expression `*x` is convertible to `T::inner` {x + 1} -> std::same_as; // the expression `x + 1` satisfies `std::same_as` - {x * 1} -> T; // the type of the expression `x * 1` is convertible to `T` + {x * 1} -> std::convertible_to; // the type of the expression `x * 1` is convertible to `T` }; ``` * **Nested requirements** - denoted by the `requires` keyword, specify additional constraints (such as those on local parameter arguments). diff --git a/README.md b/README.md index b7c5ebc..3cdae56 100644 --- a/README.md +++ b/README.md @@ -324,9 +324,9 @@ g(baz{}); // PASS. ```c++ template concept C = requires(T x) { - {*x} -> typename T::inner; // the type of the expression `*x` is convertible to `T::inner` + {*x} -> std::convertible_to; // the type of the expression `*x` is convertible to `T::inner` {x + 1} -> std::same_as; // the expression `x + 1` satisfies `std::same_as` - {x * 1} -> T; // the type of the expression `x * 1` is convertible to `T` + {x * 1} -> std::convertible_to; // the type of the expression `x * 1` is convertible to `T` }; ``` * **Nested requirements** - denoted by the `requires` keyword, specify additional constraints (such as those on local parameter arguments).