On Wed, 17 Dec 2003 14:29:26 GMT, Howard Hinnant
<> wrote:
>In article <>,
> tom_usenet <> wrote:
>
>> Well, I'd adjust it to:
>>
>> #include <iostream>
>> #include <ostream> //required for non-members
>>
>> int main()
>> {
>> std::cout << "\a\n";
>> return 0;
>> //cout implicitly flushed on program exit.
>> }
>
>Just curious: Have you come across any implementation where the
><ostream> is actually required?
Nope, other than the Deathstation 9000. I thought that Dietmar's cxxrt
might be one, but it too includes <istream> and <ostream> in
<iostream>.
There is considerable debate on whether
>we really want to break every single C++ text which has shown the
>traditional "HelloWorld" with only <iostream>.
Many hello world programs seem to use std::endl for no good reason,
and I could certainly envision an implementation that doesn't expose
endl unless ostream is explicitly included. But not to include the
non-member operator<<'s (for char*) would be a bit crazed - hello
world output would become a random pointer value!
>Martin Sebor has done an admirable job of trying to bring this issue to
>the committee. Unfortunately I don't think he has entirely succeeded
>yet.
Good luck to him! It doesn't seem very important though, just ironic
that the canonical hello world program relies on unspecified
behaviour.
Tom
C++ FAQ:
http://www.parashift.com/c++-faq-lite/
C FAQ:
http://www.eskimo.com/~scs/C-faq/top.html