id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2857,change return type of the c_array() member function,hervemart1@…,Marshall Clow,"Currently the return type of c_array() member function is T* for boost::array. Regarding its name we could expect from this function to return a reference on a C array rather than a pointer on the first element of the array. In returning T* type a piece of information about the C array is lost since the static size N is not transmitted. I suggest to change the existing c_array() member function: {{{ T* c_array() { return elems; } }}} into, {{{ T (&c_array())[N] { return elems; } }}} The both implementation are pretty similar since a reference on array is implicitly convertible into a pointer on the 1st element of this array. These following kind of lines of code would still work: {{{ array toto; int* item_ptr = toto.c_array(); }}} but purist would now be able to write {{{ int (&toto_ref)[10] = toto.c_array(); }}} The improvement which would be brought by the change is that in our example sizeof( toto.c_array() ) would return value 10*sizeof(int), the real size of the C array. best regards, herve",Patches,closed,To Be Determined,array,Boost 1.38.0,Cosmetic,fixed,,niels_address_until_2010-10-10@…