page = arthur o'dwyer – stuff mostly about c++
url = https://quuxplusone.github.io/blog
requires
-clause syntax pitfall
compiler-diagnostics concepts implementation-divergence pitfalls slack
In my CppCon 2018 talk “Concepts As She Is Spoke,” I presented some pitfalls in
-clause syntax, such as:
template<class T> concept HasHash = requires (const T& t) { t.hash() -> std::integral; }; struct X { int hash() const; }; static_assert(!HasHash<X>);
On the cpplang Slack today, John Eivind Helset and Eugenio Bargiacchi (inadvertently) showed me a new trap I hadn’t seen before: …