Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-02-11 13:13:29


The newest version of Boost had some namespace fixes for "array_traits.hpp,"
so I decided to try it out on my CRC code. I have these variables:

> unsigned char const data[] = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
> 0x38, 0x39 };
> std::size_t const data_len = boost::size( data );

The problem was I got an error for using "boost::size":

> Error : function call 'size(const unsigned char *)' does not match
> 'boost::size(T0 &)'
> 'boost::size(T0[{targ_expr}] &)'
> 'boost::size(const T0[{targ_expr}] &)'
> crc_test.cpp line 37 std::size_t const data_len = boost::size( data );
>

I actually only had two failed "boost::size" functions, but I got the third
after temporarily #defining "__GNUC__".

I've gone back to the "sizeof(data)/sizeof(data[0])" workaround, but why did
my code treat "data" as a pointer decay instead of an array reference? Is
my compiler, Metrowerks CodeWarrior Pro 5.3 for the Mac OS, too old?

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

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