
15 Mar
2009
15 Mar
'09
9:57 a.m.
No need to change the original implementation of array::c_array()! Your change of its return type should be sufficient: T (&c_array())[N] { return elems; }
Andrey Semashev wrote:
Why not simply accessing elems directly? It's public.
It looks like it's indeed okay to access boost::array::elems directly. But tr1::array::elems is marked as "Exposition only". Other TR1 implementations have indeed named their tr1::array data member differently. Unfortunately c_array() is also specific to Boost. So I've proposed to add this member function to std::array as well (LWG issue #930), returning a reference to the array. (Including overloads for const and rvalue arrays.) Kind regards, Niels