Boost logo

Boost :

Subject: Re: [boost] [xint] Boost.XInt formal review
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-03-05 12:01:57


On Mar 3, 2011, at 3:58 PM, Vicente Botet wrote:
> * The implementation should avoid virtual functions as no needed in this
> domain. Instead the library should use the CRTP which is well adapted to
> this kind of abstractions.

There are no virtual functions in integer_t; I think Vicente meant virtual inheritance of integer_t_data.

Virtual inheritance adds a little bit of overhead to member access - usually offsetting by a value stored in a virtual function table (which wouldn't otherwise be needed here). CRTP avoids this nicely. It is more efficient because the cast involved knows the offset statically whereas virtual inheritance only knows the offset at runtime.

Trying to help bring this back to a technical discussion,
Gordon


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