Boost logo

Boost :

Subject: Re: [boost] [gsoc] Pointer Plus Bits Behavior and Interface
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2010-07-15 21:48:47


>
>
> > So here are some of the questions I would like to pose to the community
> > about the behavior and interface of the pointer_plus_bits data structure:
>
> I think it should look, where practical, like either a tuple<T*,
> bitset<N>> or a tuple<T*, bool, bool, ...>
>
> Then it doesn't need to provide any pointer-like operations.
>

The class is called "pointer... plus bits". If the abstraction isn't at
least a little bit pointer-like, then the name of the data type is
duplicitous at best. I think that some of the suggestions treat lightly the
attachment that programmers have to the meanings of names.

I think it might be worthwhile to provide an interface that "explodes" the
data type into a tuple. I actually prefer the idea of offering methods that
return the pointer and bitfield as component parts. I believe these could
also return proxies to allow assignment to and from the ptr type.

But if you don't at least provide a boolean cast and a dereference operator,
then I don't think you should be using "pointer" in the name of the class.

Andrew Sutton
andrew.n.sutton_at_[hidden]


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