question on code in PointerIntPair.h

around line 45 a bitmask is computed as:

    PointerBitMask =
      ~(uintptr_t)(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),

my question is why is the shift performed on intptr_t? Wouldn't the
following be ok?
    PointerBitMask =
      ~(((uintptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),

Thanks in advance,


Hi Maurizio, why do you ask? Is the existing code causing a problem?


Not at all (I'm not really a llvm/clang user yet, only an interested

The reason is that this particular file has been mentioned on the boost
developer mailing list in a thread on compressed pointers/integer

I'm working on bringing some code of mine up to boost standards for a
review and I was tracking down all things in that thread.

I noticed thatyou were doing things differently from me and I was
wandering if there was a reason that I couldn't see.

Are you aware of a reason?


They seem equivalent to me.