Thread: STLport

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    28

    STLport

    Currently, I've been researching on how C++ itself works. In other words, what the standard is, how things need to be defined, etc. Anyways, I came across the an STL implementation that seems act like a "universal" STL.

    QUESTION: What is the features of using something like STLport?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> Anyways, I came across the an STL implementation that seems act like a "universal" STL.

    The STL itself is simply a concept (a contract, if you will) of an interface. Most implementations are practically "universal" in the sense that they support multiple platforms. So when choosing a particular implementation it really just boils down to which is most efficient for your platform, and perhaps what extensions, if any, you're wanting.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    Alright, thanks. I just noticed that the STLport's features are usually implemented in any every other STL implementation and as a result I figured perhaps there was an advantage to it for some reason... Thanks for the response.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    In our company, we use STLPort over the STL that comes with the Microsoft compiler because performance measurement showed a considerable speedup when doing so (on the order of 5-10%). That's really the primary reason to use an alternative STL. Because the interface of the STL (and the entire standard library) is fixed, the reason for switching is usually in the non-functional are like ease of debugging and speed. Some implementations offer extensions that can be of interest, but by using those you lose portability, which is not good.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The STL is just that -- a standard library. Even though they implement the same interface, they can do so poorly or well. The advantage is (presumably -- I've never used them or compared them) not in what they offer but how well they do it.

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    Alright, yet another good response. Better implementation and more portability. I think I'll look into this further...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Integrating Boost with STLPort
    By Mario F. in forum Tech Board
    Replies: 1
    Last Post: 11-11-2006, 06:49 AM
  2. STLport with MingW - Long Long error on project build
    By Mario F. in forum C++ Programming
    Replies: 2
    Last Post: 08-21-2006, 08:55 AM
  3. STLPort with Dinkumware
    By Kiske in forum C++ Programming
    Replies: 1
    Last Post: 05-23-2005, 12:56 PM
  4. problems Installing stlport with vc7
    By silk.odyssey in forum C++ Programming
    Replies: 0
    Last Post: 12-22-2003, 09:09 AM
  5. STLport precompiled?
    By aker_y3k in forum C++ Programming
    Replies: 0
    Last Post: 10-13-2002, 03:41 AM