
"christopher diggins" <cdiggins@videotron.ca> wrote in message news:007501c56609$1ff361f0$2b792518@heronnest... | ----- Original Message ----- | From: "Allen" <yaozhen@ustc.edu> | To: <boost@lists.boost.org> | Sent: Tuesday, May 31, 2005 1:29 PM | Subject: [boost] Re: Boost Array Initialization Technique | | | > Did you see the Boost Assign Library: | > | > http://www.boost.org/libs/assign/index.html | | Yes. However, unless I am mistaken, it can only be used with back-insertable | containers. There are of course other techniques than the one I proposed. My | point is that I believe comma initialization to be superior to aggregate | initialization, and that not making boost:array a conformant reversible | container to be a mistake. in the new boost, we might say array<int,5> a; a = cref_list_of<5>(1)(2)(3)(4)(5); if efficiency is important. Missing values are inserted as 0, and bounds are checked otherwise. The real benefit is of course when dealing with classes: struct X { X() {} X(int, int) {} }; array<X,4> a; a = list_of<X>(1,1)(1,2)(1,3)(1,4); -Thorsten