c array parameter in resize method of multi_array
Hi,
is there any reason to refuse a resize method for multi_array that accept a C
array as parameter ?
As long as the resize method just works if the boost::extents parameter has the
same dimension as the array to be resized a call like that:
typedef boost::multi_array
On 7/10/06, Manuel.Yguel@inrialpes.fr wrote:
Hi, is there any reason to refuse a resize method for multi_array that accept a C array as parameter ? As long as the resize method just works if the boost::extents parameter has the same dimension as the array to be resized a call like that:
typedef boost::multi_array
array_type; array_type A( boost::extents[3][4][2] ); ---> A.resize( {6;5;2} );
could be understood as: A.resize( boost::extents[6][5][2] ); without any ambiguity, am I wrong ?
I would assume that a boost::extents parameter contains its dimension. A C array does not, so there's (AFAICT) no way to do either compile-time or run-time checks to ensure that you didn't type one of: A.resize( {6,5,2,5} ); or A.resize( {6,5} ); Dale
On Mon, 10 Jul 2006, Dale McCoy wrote:
On 7/10/06, Manuel.Yguel@inrialpes.fr wrote:
Hi, is there any reason to refuse a resize method for multi_array that accept a C array as parameter ? As long as the resize method just works if the boost::extents parameter has the same dimension as the array to be resized a call like that:
typedef boost::multi_array
array_type; array_type A( boost::extents[3][4][2] ); ---> A.resize( {6;5;2} );
could be understood as: A.resize( boost::extents[6][5][2] ); without any ambiguity, am I wrong ?
I would assume that a boost::extents parameter contains its dimension. A C array does not, so there's (AFAICT) no way to do either compile-time or run-time checks to ensure that you didn't type one of: A.resize( {6,5,2,5} ); or A.resize( {6,5} );
Then how about accepting a boost::array argument? -- François Duranleau LIGUM, Université de Montréal "La terre appartient à tout ce qui existe. Le véritable mode humain de vie est le partage. La possession est l'acte suprême d'exclusion d'autrui par pur égoïsme." - Le Vrai Peuple, dans _Message des hommes vrais au monde mutant_ (de Marlo Morgan)
participants (3)
-
Dale McCoy
-
François Duranleau
-
Manuel.Yguel@inrialpes.fr