STLPort: native iostreams and STLPort strings? 
Author Message
 STLPort: native iostreams and STLPort strings?

I am trying to use STLPort 4.0 under Visual C++ 6.0.

I read this in the config manual:

IMPORTANT: DO NOT use SGI <string> with native <iostream> unless you
recompile standard C++ runtime library with STLport installed, or
(better) define __STL_USE_OWN_NAMESPACE

For various reasons I am forced to use native iostreams, and I really
do not want to recompile the standard C++ runtime library. So - if I
go with the "better" option of defining __STL_USE_OWN_NAMESPACE, then
what does this mean in terms of using STLPort strings with native
iostreams? Does this mean that I can do the following:

#include <iostream.h>
#include <string>

...

stlport::string strExample("this is a test");
cout << strExample << endl;

?

        Thanks,
                Ethan Shayne



Fri, 21 Mar 2003 03:00:00 GMT  
 STLPort: native iostreams and STLPort strings?

[...]

Quote:
> For various reasons I am forced to use native iostreams, and I really
> do not want to recompile the standard C++ runtime library. So - if I
> go with the "better" option of defining __STL_USE_OWN_NAMESPACE, then
> what does this mean in terms of using STLPort strings with native
> iostreams? Does this mean that I can do the following:

> #include <iostream.h>
> #include <string>

> ...

> stlport::string strExample("this is a test");
> cout << strExample << endl;

I doubt it -- I wouldn't imagine stlport would have the necessary
machinery to use classical iostreams this way.  OTOH, you -might- be
able to do it if you change <iostream.h> to <iostream>.

--
Craig Powers




Sat, 22 Mar 2003 03:00:00 GMT  
 STLPort: native iostreams and STLPort strings?
Why -- the example provided should work fine, though I would write
"std::string" which would have the same effect but is portable.

-Boris.



Quote:

> [...]

> > For various reasons I am forced to use native iostreams, and I
really
> > do not want to recompile the standard C++ runtime library. So - if I
> > go with the "better" option of defining __STL_USE_OWN_NAMESPACE,
then
> > what does this mean in terms of using STLPort strings with native
> > iostreams? Does this mean that I can do the following:

> > #include <iostream.h>
> > #include <string>

> > ...

> > stlport::string strExample("this is a test");
> > cout << strExample << endl;

> I doubt it -- I wouldn't imagine stlport would have the necessary
> machinery to use classical iostreams this way.  OTOH, you -might- be
> able to do it if you change <iostream.h> to <iostream>.

> --
> Craig Powers



Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 23 Mar 2003 11:24:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MSVC++ 6.0, STLPort and iostreams

2. STLport and "SGI iostreams": benefits?

3. iostreams with STLPort

4. STLport with iostreams in eVC

5. STLPort, MFC and memory leak report

6. Debugging STLport

7. STLPort, MFC and memory leak report

8. Using STLport?

9. VC.NET 2003 and STLPort compatibility

10. VC and STLPort

11. HELP: how to use stlport's hashtable?

12. stlport 4.5.3

 

 
Powered by phpBB® Forum Software