Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-06-21 22:23:27


Good suggestion, but let's reserve ALL_CAPS names for preprocessor macros,
OK?
Thanks,
Dave
----- Original Message -----
From: <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, June 21, 2000 2:35 PM
Subject: [boost] array formal review

>
> I often find it usefull to be able to access the array size at
> compile-time, even when the array is coming in as a plain template
> argument. Therefore it would be nice to have an enum that provides
> public access to N.
>
> template<class T, std::size_t N>
> class array {
> public:
> enum { SIZE = N };
>
> ...
> };
>
>
> Note, this can also be done with a static const int... but there are
> some comiler (VC++) portability issues.
>
> Cheers,
>
> Jeremy


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