2 ms·
And 46% said they will use concepts. I guess people are overestimating a lot or the panel was C++ aficionados.
by rightbyte 5y ago
And 46% said they will use concepts. I guess people are overestimating a lot or the panel was C++ aficionados.
- bluGill 5y ago46% seems way too high. Most C++ programmers just use templates without writing them, so concepts are of no use as the compiler can figure out from the simple types what is wrong with the code and give a good error message. Until you have to write generic code concepts don't have much use, and that seems to be around 10% of C++ programmers. 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.
- logicchains 5y agoIf 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.
- otabdeveloper4 5y agoNo, 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.