Mail Archives: djgpp/2001/10/08/04:49:41
"Traveler" <traveler AT netti DOT fi> wrote in message news:<9pque5$eui$1 AT tron DOT sci DOT fi>...
> Hi!
>
> Have you ever be annoyed to write code like this every time you just
> want to list elements of some array ?
>
No. Never.
>
> "int someArray[] = {4,54,12,9,234,89,5};
>
> unsigned long length = sizeof(table)/sizeof(table[0]);
>
> for(unsigned long index = 0;index < length;index++)
> cout << someArray[index] << endl;"
>
> Wouldn?t it be nice to have it like this ?
>
> "int someArray[] = {4,54,12,9,234,89,5};
> cout << someArray << endl;"
Maybe.
>
> Well, no fear when the Traveler is here ! ;)
> I have just the thing you are looking for. I have overloaded the "<<"
> operator for few table types and I trust that you can do the trick for
> rest of the ones you want.
>
[snip]
What's wrong with using a vector and for_each()?
Jon.
- Raw text -