Sign in to follow this  
mindscout

C++ STL Question

Recommended Posts

Guest Anonymous Poster
I think STL is good.

The best advice would probably be to use it and see if you like it, everyone has their own preferences, so just give it a go and see how it kicks out.

- Steve

Share this post


Link to post
Share on other sites
It's extremely efficient, bearing in mind that generality was also a major design factor. More importantly, it is very safe. And yes, it is very portable.

Share this post


Link to post
Share on other sites
Places where you don't use the STL (and be careful with C++ in general): embedded devices (mobile phones, handheld consoles, ...).
Even on consoles the STL comes in handy if it's not over-used.

Share this post


Link to post
Share on other sites
Quote:
Original post by Phillip Martin
Windows, Solaris, Linux, MacOSX.
Don't forget IRIX, BeOS, the BSDs, Mach, SunOS, etc. It works on all OSes that GNU's libstdc++ works on(so all the OSes that G++ works on). AFAIK, GNU's libstdc++ STL implementation doesn't contain any platform-specific code, so it should work on all modern OSes(probably even some slightly older ones). Where did you get the idea it isn't portable? It's only really only an API anyway...

Share this post


Link to post
Share on other sites
Quote:
Original post by Roboguy
Quote:
Original post by Phillip Martin
Windows, Solaris, Linux, MacOSX.
Don't forget IRIX, BeOS, the BSDs, Mach, SunOS, etc. It works on all OSes that GNU's libstdc++ works on(so all the OSes that G++ works on). AFAIK, GNU's libstdc++ STL implementation doesn't contain any platform-specific code, so it should work on all modern OSes(probably even some slightly older ones)


I didn't forget them, I just don't use them :D

Was responding to mindscout asking "Phillip, on which platforms did you use it ?", but I forgot to hit the quote button.

Share this post


Link to post
Share on other sites
Portability is pretty much a non-issue. The STL was integrated as part of the C++ Standard Library, so if your compiler is standards compliant, then it'll have STL support. The only major sore spot in STL portability right now is all those people who are still using MSVC 6 since VC 6 doesn't grok template member functions; so some things like std::list::sort() aren't supported properly.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Portability is pretty much a non-issue. The STL was integrated as part of the C++ Standard Library, so if your compiler is standards compliant, then it'll have STL support. The only major sore spot in STL portability right now is all those people who are still using MSVC 6 since VC 6 doesn't grok template member functions; so some things like std::list::sort() aren't supported properly.


This sums up the STL situation very well. Most current compilers are mostly standard comforming, so chances are, everything will work.

Off topic:
Although for anyone interested, we hit a wrinkle in the STL implementation of maps and sets for VC7.1. The red black tree implementation makes a few non-standard assumptions with the tree's max_size() method vs the allocator's max_size() method. Pretty interesting stuff (at least for me :D)

Share this post


Link to post
Share on other sites
Quote:
Original post by Phillip Martin
Off topic:
Although for anyone interested, we hit a wrinkle in the STL implementation of maps and sets for VC7.1. The red black tree implementation makes a few non-standard assumptions with the tree's max_size() method vs the allocator's max_size() method. Pretty interesting stuff (at least for me :D)

That standard provides practically no guarantees for the behavior of max_size(), so it's hard for it to make any non-standard assumptions.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Quote:
Original post by Phillip Martin
Off topic:
Although for anyone interested, we hit a wrinkle in the STL implementation of maps and sets for VC7.1. The red black tree implementation makes a few non-standard assumptions with the tree's max_size() method vs the allocator's max_size() method. Pretty interesting stuff (at least for me :D)

That standard provides practically no guarantees for the behavior of max_size(), so it's hard for it to make any non-standard assumptions.


Rather than taking over the thread, I started a new one.
http://www.gamedev.net/community/forums/topic.asp?topic_id=286892

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I think STL is good.

The best advice would probably be to use it and see if you like it, everyone has their own preferences, so just give it a go and see how it kicks out.

- Steve


Actually I use it at work and I like it. But I was unsure about its portability and performance. Thanks for the answers this thread was very useful...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this