News for hackers. Stuff that matters.
Re:C++17 and other future highlights of C++ by jordigh on Thursday March 10, 2016 @12:05PM (#11260381)
Special functions?[1] Why do they keep wanting to add that to the standard? They've been trying to get special functions into the standard since C++11 (née C++0x). That seems like such a very niche use, better left for specialised libraries where numerical researchers can work out the very best algorithms rather than for a standard system library. I mean, compared to accessing a filesystem or parallel processing, how many C++ users regularly need the Riemann zeta function or a modified Bessel function of the second kind?

---

[1] https://en.wikipedia.org/wiki/Special_functions

Re:C++17 and other future highlights of C++ by humanrebar on Thursday March 10, 2016 @05:13PM (#11262894)
> ...how many C++ users regularly need the Riemann zeta function or a modified Bessel function of the second kind?

I've wondered the same thing myself. They're probably easier to standardize since the specification for that behavior is already done by mathematicians. And the implementation is generally re-entrant so the possibility of show-stopper design bugs is minimal.

Getting concepts wrong, in contrast, has a much larger downside.

Not saying special maths should be standardized. Just attempting to describe the phenomenon.

Re:C++17 and other future highlights of C++ by lobo_tuerto on Thursday March 10, 2016 @12:39PM (#11260582)
Maybe because the need for them has popped up enough times and they tought it would be a good idea to add them to the standard? Also that addition wouldn't hurt no one.
Re:C++17 and other future highlights of C++ by jordigh on Thursday March 10, 2016 @12:46PM (#11260631)
> Also that addition wouldn't hurt no one.

Library implementors would have to implement it. Most of them are probably unqualified to do it, so they'll probably just grab Boost's implementation. And Boost's implementation would be unreadable to most implementors. Thus everyone would get a slightly subpar implementation, because most numerical researchers are not keeping an eye on Boost and making sure it has the best methods available. The end result is that those in the know will avoid the C++ stdlib, just like Qt did and reimplemented strings and maps.

We've seen this problem before with valarray and with export. There is a problem with standardising something that nobody wants or nobody can implement correctly.

Re:C++17 and other future highlights of C++ by Someone on Thursday March 10, 2016 @06:04PM (#11263231)
The flip side is that I would rather use a “slightly subpar” implementation than having to roll my own from a Google search and some smart guessing.

For example, if you want to implement a Student's t-test, you soon will run into the problem that you want to have a Beta function or the gamma function.

One could probably copy-paste a somewhat working version together from search engines, add asserts to prevent me from ever calling them with arguments out of the range where it seems to work, but for most of us, the result likely will be slower and less precise than a version that gcc, clang, or commercial compilers would provide.

And yes, I could probably buy an implementation somewhere, but in the real world, that often isn’t a real option, and even then, I wouldn’t know how well it worked, either.

Re:C++17 and other future highlights of C++ by GFK_of_xmaspast on Thursday March 10, 2016 @09:55PM (#11264350)
Wouldn't it be pretty easy to compare a re-implementation of a special function against a reference boost implementation? For example, there are only 232 floats and for a given function you can check them all very quickly. It's a little trickier for doubles, but one can imagine doing, say, 240 tests and getting a reasonable level of confidence.
Re:C++17 and other future highlights of C++ by meetingcpp on Thursday March 10, 2016 @01:56PM (#11261251)
Well, they have been accepted into the standard last week ;)