|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-06-25 17:43:26
Gennaro Prota <gennaro_prota_at_[hidden]> writes:
> On Sun, 25 Jun 2006 11:37:51 -0400, David Abrahams
> <dave_at_[hidden]> wrote:
>
>>The biggest argument for such a mechanism is that it should be more
>>foolproof. I hope it causes a compile error if "array" turns out to
>>be a pointer.
>
> Yes, of course.
In that case, yes, it's very much worth including. Everytime I write
sizeof(a)/sizeof(a[0]) I think "I know there's a better way to do
this, but I don't have the time right now..." Libraries save us from
that sort of cognitive dissonance when coding.
> I've reattached an implementation I proposed here a
> couple of years ago. The reason why I'm asking is basically that it
> would require some "somersault" to make it work with VC6 and other
> broken compilers, so I woldn't spend time on that if there is no
> interest.
That somersault is easy enough (although I've forgotten what it was
exactly, there's an easy workaround).
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk