Boost logo

Boost :

Subject: Re: [boost] Proposal: boost::make_array()
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2013-01-16 09:21:30


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Thorsten Ottosen
> Sent: Wednesday, January 16, 2013 8:23 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] Proposal: boost::make_array()
>
> On 15-01-2013 13:30, Beman Dawes wrote:
> > On Sat, Jan 12, 2013 at 11:45 AM, Kyle Lutz <kyle.r.lutz_at_[hidden]> wrote:
> >> I'd like to propose a new function for the Boost Array library named
> >> make_array()...
> >
> > Proposals for make_array have surfaced in the past, both on the Boost
> > list and elsewhere. You might want to take a look at some these to
> > gain insights.
>
> You can also do
>
> boost::array<int,42> a = boost::assign::ref_list_of<3>( 0 )( 1 )( 2 );

You can - but nearly everyone won't :-(

Kyle's make_array looks *far* more appealing.

It's unnecessary difficulty with trivial issues like array initialization that give C++ a bad name.

(And of course if the idiotic decision not to make arrays first class citizens hadn't been inherited
from C...)

And Joshua's table way also meets another very common need.

I think these two (together preferably) needs Boostifying and writing up with some examples, docs
and tests, and review.

Paul

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk