
Zitat von Joaquin M Lopez Munoz <joaquin@tid.es>:
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.
I'd say an interface with pointer semantics is useful, but can be built upon the a interface like you're describing. for example: pointer_plus_bits<...> a; to access the pointer part: pointer_view<...> ptr(a); //++ptr; //ptr has ptr-semantics, can be used as an iterator, etc. to access the "bits" part: integral_view<...> i(a); i=3; bitset_view<...> bitset(a); bitset.set(2,true); I'm also wondering why this has to be limited to pointer plus bits? unused bits in a variable isn't something that is limited to pointers. an integer variable might always be even, or have a maximum value so that upper bits are always unused.