Boost logo

Boost :

Subject: Re: [boost] [Boost-users] [review] Multiprecision review scheduled for June 8th - 17th, 2012
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2012-05-30 18:38:53

Vincente wrote :
> * I think that the fact that operands of different backends can not be
> mixed on the same operation limits some interesting operations:

I agree, but supporting it comes with a lot of problems.

> I think it should be possible to mix backends without too much
> complexity and that the library could provide the mechanism so that
> the backend developer could tell to the library about how to perform
> the operation and what should be the result.

That is assuming the backend isn't legacy. We need to keep gmp in mind as being the example of a backend that needs to be supported. Certainly the library could build a way to allow the user to specify the conversions, but that wouldn't be easy for the library or the user, nor would it be without problems. If I want to mix backend A and backend B I have to provide specialization of some hypothetical library template for the conversion, but if someone else wants to mix backend A and backend B and does the same then we cannot coexist within the same compilation unit. Forcing explicit conversion is both simpler and will make user code more clear because the types actually used in the operation will be explicit rather than requiring knowledge of how different mixes are handled by some code that is elsewhere and used implicitly.

I see pluses and minuses to supporting mixed operations.


Boost list run by bdawes at, gregod at, cpdaniel at, john at