Boost logo

Boost :

Subject: Re: [boost] [array] change proposal for the c_array() function
From: David Abrahams (dave_at_[hidden])
Date: 2009-03-18 08:11:51

on Sat Mar 14 2009, herve martin <> wrote:

> Hi,
> I'm new in this mailing list .My interest are embedded software and code
> reuse.
> I would submit a simple change request in the boost::array library.
> The boost::c_array() function is expected to cast a boost::array<T,N> into a
> C-array but actually the returned type is a T* which is not exactly a
> reference on a C-array.
> to keep track of the static size and make sizeof( myarray.c_array() )
> returning the real size of the C-array,
> I suggest to change:
> T* c_array() { return elems; }
> into
> T (&c_array())[N] { return *(T(*)[N]) elems; }

Looks good in principle. What is the status of that function in TR1 and
the latest draft standard? If it is different from your proposal, we
should probably think about the consequences.

Dave Abrahams
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at