on Sat Aug 27 2011, Michael Fawcett
On Sat, Aug 27, 2011 at 7:02 AM, John Maddock
wrote: It's not that they're "not generic enough", it's that they use different concepts for their number types, Boost.Math has a well defined concept that all number types must obey: http://www.boost.org/doc/libs/1_47_0/libs/math/doc/sf_and_dist/html/math_toolkit/using_udt/concepts.html.> It also has concept checking programs and concept archetypes to verify that our code really does stick to the stated concept requirements and no more: http://www.boost.org/doc/libs/1_47_0/libs/math/doc/sf_and_dist/html/math_too...
Could the entire ResultType column be done away with, being replaced everywhere in code with "auto"?
No.
In other words, the Concept we are looking for is that the type supports the operation, but we don't necessarily care about the result type except that it also supports the subsequent operations required.
There's been extensive research work in this area, and there's no easy fix if you want to say something meaningful. You'd need to make the result an associated type and specify its required relationships with the input types. -- Dave Abrahams BoostPro Computing http://www.boostpro.com