Boost logo

Boost :

Subject: Re: [boost] [gsoc] Pointer Plus Bits Behavior and Interface
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2010-07-15 10:27:43


Brian Bartman <bbartmanboost <at> gmail.com> writes:

> Hello,
>
> Pointer Plus Bits: Is a data structure which points to specifically aligned
> object such that the value of the address is divisible by a power of two
> (the power of two which it is divisible by is given as a template argument).
> The empty bits of the pointer are then used to store extra boolean values
> relating to something [...]

FYI, there's some code at

http://bannalia.blogspot.com/2008/11/optimizing-red-black-tree-color-bits.html

that you might want to leverage for your work.
 
> 1) Should the pointer_plus_bits have a pre and post increment and decrement
> ( what about supporting other arithmetic operations such as add, minus, add
> assign etc...) ?

I'd say this is gratuituous complication: just design a lean
interface providing get_pointer, set_pointer, get_bit, set_bit
(or similar names) so that you don't have to replicate pointer
semantics.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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