Clang10 ist im Arch Repo gelandet und ich spiel mich mal wieder mit
Concepts. Leider musste ich grad feststellen dass sich die Syntax in den
sogenannten "compound requirements" extrem verschlechtert hat.
Statt wie bisher etwa
1 | template <typename T, typename U>
|
2 | concept equality_comparable = requires(T a, U b) {
|
3 | { a == b } -> bool;
|
4 | { a != b } -> bool;
|
5 | };
|
zu schreiben, darf das "return-type-requirement" selbst nur noch ein
Concept sein. Also beispielsweise so
1 | template <typename From, typename To>
|
2 | concept convertible_to = std::is_convertible_v<From, To>;
|
3 |
|
4 | template <typename T, typename U>
|
5 | concept equality_comparable = requires(T a, U b) {
|
6 | { a == b } -> convertible_to<bool>;
|
7 | { a != b } -> convertible_to<bool>;
|
8 | };
|
Hat das irgendwer mitbekommen? Das ist ja eine halbe Katastrophe. Noch
dazu wo die library concepts (und damit der entsprechende <concept>
header) noch nirgends inkludiert sind. Die Syntax erzeugt bei mir
Kopfweh. Das "convertible_to" Concept wird mehr oder weniger mit einem
"impliziten" Template Parameter aufgerufen...