Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2005-05-31 16:06:05


On Tue, May 31, 2005 at 04:12:47PM -0400, christopher diggins wrote:

> From: "Jonathan Turkanis" <technews_at_[hidden]>
> >
> >Are you saying you want boost::array to satisfy the requirements in Table
> >65?
> >
> >I think the postconditions for the expressions "X u" and "X()" will be
> >hard to
> >achieve. ;-)
>
> Not if the semantics were changed so that size() returned 0 when the array
> was unitialized (which I think would be an improvement). But fine, let's
> say that won't happen until heck freezes over, do you have an opinion on
> the fact that boost array has no constructors simply to support the rather
> obscure syntax of:
>
> boost::array a = { { 1, 2, 3; } } // notice two sets of { }

IMHO it's one of the key features. To be usable where a C array is,
but with a size() member to avoid range errors.

It is also an intended feature of Austern's block template, which
boost::array is partly inspired by.

The standard is quite clear about what happens if the double braces are
not present, so they are not required, if that's all you're concerned
about.

jon


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