I wasn't aware I thought it was a bug, thank you martin.

-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 02, 2006 2:02 PM
To: [email protected]
Subject: Re: unable to use boolalpha stream manipulator in sourcepro ed9

Scott Zhong wrote:
> cat t.cpp && gcc  -D_RWCONFIG=12d -I../../include
> -I./../../../../include -I./../../../../include/ansi t.cpp
> 
> #include <iostream>

The boolalpha manipulator is required to be declared in the header
<ios> but in no other. Implementations are allowed to #include any
library headers in any other so while your code may compile with
some it's not portable. stdcxx does its best to avoid bringing in
more symbols into scope than necessary -- it's a feature of our
implementation and a portability bug in your code :)

Martin

> 
> using namespace std;
> 
>  
> 
> int main () {
> 
>   bool b;
> 
>   b=true;
> 
>   cout << boolalpha << b << endl;
> 
>   cout << noboolalpha << b << endl;
> 
>   return 0;
> 
> }
> 
> t.cpp: In function `int main()':
> 
> t.cpp:7: `boolalpha' undeclared (first use this function)
> 
> t.cpp:7: (Each undeclared identifier is reported only once for each
> function it 
> 
>    appears in.)
> 
> t.cpp:8: `noboolalpha' undeclared (first use this function)
> 
>  
> 
> problem first appeared when using sourcepro ed6 and also appears true
> for ed9.
> 
>  
> 
> Yu (Scott) Zhong
> 
> 

Reply via email to