News for hackers. Stuff that matters.
Re:C++ Dev Ecosystem 2021 by rightbyte on Monday July 19, 2021 @05:29PM (#27887459)
And 46% said they will use concepts. I guess people are overestimating a lot or the panel was C++ aficionados.
Re:C++ Dev Ecosystem 2021 by bluGill on Monday July 19, 2021 @06:05PM (#27887807)
46% 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.

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.