Boost logo

Boost :

From: George M. Garner Jr. (gmgarner_at_[hidden])
Date: 2005-12-12 16:12:37


John,

> and in any case each element in
> the array is 8-bytes (32-bit pointers) or 16-bytes (64-bit pointers), so
> the
> alignment and size must be a multiple of 8 even if there are an odd number
> of elements.

Yes. You're right. I missed that. In any event the sizeof operator is
documented to be aligned on WORD boundaries and your expression is expressly
documented to work.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_pluslang_sizeof_operator.asp.

In any event, the specific line that is generating the warning is the
following:

BOOST_ASSERT(id < sizeof(masks) / sizeof(masks[0]));

Since the following code does not generate this warning I will need to dig
further into the boost assert macro to answer the question:

if(id < sizeof(masks) / sizeof(masks[0]))
    return masks[id];
return masks[0];

Regards,

George.


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