ostream copy constructor question while porting to Dinkumware 3.08 
Author Message
 ostream copy constructor question while porting to Dinkumware 3.08

ostream copy constructor for Dinkumware 3.08

I have an automated test framework that contains a 'static
std::ostream mOut;' which can then be assigned to just about any
output device.  The default device is cout.  I have just switched over
to the Dinkumware 3.08 library and can't find a simple way to redirect
the mOut to cout.  

With the old library this worked:

std::ostream TestBase::mOut( std::cout );

 but it no longer compiles under the 3.08 library because there is no
copy constructor.  

I know there must be another easy way to do this but I can't seem to
figure it out.

Thanks

Rob Kreger
Siemens Dematic



Wed, 18 Aug 2004 03:12:16 GMT  
 ostream copy constructor question while porting to Dinkumware 3.08
The availability of a copy-constructor is an oversight in the C++
standard. The newer implementation takes into account defect reports, in
particular DR50 "Copy constructor and assignment operator of ios_base" -
see

http://std.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#50

As a workaround, use

std::ostream* TestBase::mpOut( &std::cout );

and maybe a macro to preserve compatibility:

#define mOut (*mpOut)

--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> ostream copy constructor for Dinkumware 3.08

> I have an automated test framework that contains a 'static
> std::ostream mOut;' which can then be assigned to just about any
> output device.  The default device is cout.  I have just switched over
> to the Dinkumware 3.08 library and can't find a simple way to redirect
> the mOut to cout.

> With the old library this worked:

> std::ostream TestBase::mOut( std::cout );

>  but it no longer compiles under the 3.08 library because there is no
> copy constructor.

> I know there must be another easy way to do this but I can't seem to
> figure it out.

> Thanks

> Rob Kreger
> Siemens Dematic




Wed, 18 Aug 2004 04:18:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Visual c++ 6.0 debugger and DInkumware C++ library 3.08

2. Dinkumware 3.08 std::string performance

3. default new_handler with Dinkumware 3.08?

4. STL Error message filter for MSVC6/Native lib/Dinkumware 3.08: now available

5. Slightly OT: VC++6, Dikumware 3.08 and Stingray

6. Dinkum 3.08, VC6, and use_facet

7. Dinkum 3.08 and use_facet

8. Dinkum 3.08 and autoexp.dat

9. Copy Constructor Question

10. Copy Constructor : Copying Base Class Member Variables

11. std::ostream vs ostream

12. Serial port to serial port copying software

 

 
Powered by phpBB® Forum Software