Gaijinco wrote:
> I have used before:
>
> class A
> {
>
> };
>
> operator& operator<<(operator& out, A& a);
What is operator (the type) here? You can't have a type named so. Did you
mean std:

stream?
For outputting it would be wise to make the reference const:
std:

stream& operator<<(std:

stream& out, const A& a);
>
> cout << A();
>
> I used thinking this spent fewer memory than doing something like:
>
> A a;
> cout << a;
It would be the same, I guess. Why should it use more or less memory?
> Now I tried this and it worked:
>
> cout << int(0);
>
> Is this compiler-dependent or is a language feature?
What is compiler-dependent?
cout can output an integer, of course. It's like:
cout << 42;
--
Thomas
http://www.netmeister.org/news/learn2quote.html