
| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Thorsten Ottosen | Sent: 25 May 2006 15:02 | To: boost@lists.boost.org | Subject: Re: [boost] [array] optional constructors in Boost.Array | | Vincent Bhérer-Roy wrote: | > On 25-May-06, at 06:39, Thorsten Ottosen wrote: | | > Also, it will gives compile time errors for things like that: | > | > array<int,4> a = list_of(1)(2)(3).to_array( a ); // compiles fine | > array<int,4, true> a(1,2,3); // doesn't compile | | Note that the former zero-initializes the remaining elements. This is exactly what is NOT wanted. Although zeros are slightly better than a random not-initialised value, it is far, far better to get a compile time message when clearly one meant to initialize all the elements. This is a fundamental mistake in C philosophy IMO. It you want an array un-initialized, one should have say so very specifically. Otherwise, failure to initialize all the array is a mistake. (other languages have convenient syntax for repeat counts, but that another step). Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com