Boost logo

Boost Users :

Subject: Re: [Boost-users] [math][tools][units] generic libraries notgenericenough
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-08-28 13:59:26


on Sat Aug 27 2011, Michael Fawcett <michael.fawcett-AT-gmail.com> wrote:

> On Sat, Aug 27, 2011 at 7:02 AM, John Maddock <boost.regex_at_[hidden]> 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_toolkit/using_udt/archetypes.html
>
> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net