Boost logo

Boost :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2008-08-01 07:02:14


Daniel Frey wrote:

> On Thu, 2008-07-31 at 14:20 -0500, Michael Marcin wrote:
>> Daniel Frey wrote:
>> > On Thu, 2008-07-31 at 12:16 -0500, Michael Marcin wrote:
>> >>
>> >> Be sure to check the size of your type with your compiler. Some
>> >> embedded and DSP compilers in the past made types that derive from
>> >> operators larger. Although I think that was partially due to a
>> >> operators bug that was fixed a long time ago.
>> >
>> > AFAIK that's not a bug in the operators library, but an inefficiency in
>> > the compiler's ABI (the EBO actually, which misses some optimization
>> > opportunities for multiply inheritance from empty base classes).
>>
>> I was referring to http://svn.boost.org/trac/boost/ticket/979 which bit
>> me on a project where we had a fixed-point 3 coordinate vector which had
>> operators which contained a fixed-point types which had operators.
>
> That won't help in Neal's code unless he starts using the base class
> chaining. Since empty_base only takes T into account (not U if
> available), Neal's code would still contain the same base class (empty<
> fixed_pt<int_bits,frac_bits,base_type,error_policy,round_policy> >)
> multiple times, which might lead to some bloat.
>
> Regards, Daniel

I'll have to look into it. I'm using gcc-4.3.0, which I was guessing is not going to suffer bloat, so I didn't bother about using the chaining.


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