by bluGill · 5y ago · 0 comments
Unless you mean as in use them to diagnose an error in your use of generic code that you use. Then if you are using a high enough C++ you will use them - though probably without even knowing it.
Concepts are pretty useless at the moment for error messages, but they're super easy and convenient when you need to disambiguate something like
void do_it(auto& x) { // x is a vector
void do_it(auto& x) { // x is nlohmann::json
Just stick a 'requires' in there and it works. auto myFunc(auto& x, auto& y){....}
They're technically using concepts, as auto function params are part of the c++20 concepts stuff.