Boost logo

Boost :

Subject: Re: [boost] [xint] Third release is ready, requesting preliminary review
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-05-03 15:40:19


----- Original Message -----
From: "Chad Nelson" <chad.thecomfychair_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, May 03, 2010 7:52 PM
Subject: Re: [boost] [xint] Third release is ready, requesting preliminary review

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 05/03/2010 01:28 PM, vicente.botet wrote:
>
>>>> It's not really feasible to push it to the derived classes, since
>>>> it would involve a lot of duplicate code. The memory management
>>>> is almost completely identical between all of the integer types,
>>>> so it makes more sense to have it in a base class.
>>
>> You need to mut the minimal part on the derived part, but don't add
>> to much on the base class.
>
> The usual way to do that is via virtual functions. I've been trying to
> avoid virtual functions in the base_integer class, for efficiency's
> sake; the intermediary class mentioned below is intended to solve the
> problem without need of them.

Chad I need to ask you if you knwo the tecnique we are suggesting you, i.e. CRTP Curious Recurring Template Pattern. If this is not the case we could explain you in more detaill how it wan be used to your case.
 
>>>> However, as I mentioned yesterday, I've found a need to separate
>>>> the memory management functions from the base class anyway. I
>>>> plan to move them into an intermediary class, something that
>>>> inherits from base_integer, and that all the derived classes
>>>> inherit from.
>>
>> This should not solve the problem as both integer and fixed will
>> inherit from this intermediary class.
>
> Of course they will. That's the whole point. What *is* the problem then,
> that a possibly-templated intermediate class wouldn't solve it?

That the intermediary class will contain information that is specific to the fixed_integer class.
We will see when you implement it. Review this thread to check what was the problem when you said the intermediary class will solve it.

Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk