|
Boost : |
Subject: Re: [boost] [array] change proposal for the c_array() function
From: Niels Dekker - address til 2010-10-10 (niels_address_until_2010-10-10_at_[hidden])
Date: 2009-03-18 13:36:33
Herve Martin wrote:
> I suggest to change:
> T* c_array() { return elems; }
> into
> T (&c_array())[N] { return *(T(*)[N]) elems; }
David Abrahams wrote:
> 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.
Hi Herve,
David and I just mailed about the issue and we agreed that it would be
preferable to have such a function as a non-member. Because tr1::array
doesn't have such a c_array() member function and std::array probably
won't have one either. Such a boost::get_c_array(arg) function
(template) could be overloaded to support both std::array and
boost::array. For details, please have a look at
https://svn.boost.org/trac/boost/ticket/2857#comment:2
HTH, Niels
-- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk