Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-07-13 20:41:03


 Alexander Nasonov <alnsn_at_[hidden]> wrote

> Arkadiy,
> I put a reference to your library to Russian site www.rsdn.ru.
> Shortly after that Andrey Beliakov commented out sizer class.
> He writes that sizeof(sizer<N>) is not necessarily equal to
> N::value. Andrey suggests rewriting the sizer:
>
> template<class N> struct sizer
> {
> typedef char(&type)[N::value];
> };
>
> and use sizer<N>::type in place of sizer<N>.

Cool! The only reason I wrote sizer in the first place was because I wasn't
able to return an array from the function. And it turns out all I had to do
was to use a reference to array... I will probably eliminate this class,
and use char(&)[n] directly.

Arkadiy


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