Re:C++ Dev Ecosystem 2021
by otabdeveloper4 on Tuesday July 20, 2021 @06:23AM
(#27891974)
No, it's the other way around.
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.
Re:C++ Dev Ecosystem 2021
by logicchains on Tuesday July 20, 2021 @02:07AM
(#27890568)
If someone writes:
auto myFunc(auto& x, auto& y){....}
They're technically using concepts, as auto function params are part of the c++20 concepts stuff.
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.