STL for fun and profit

This is a discussion on STL for fun and profit within the C++ Programming forums, part of the General Programming Boards category; Programming with Macros, great. What a mess. It's okay if you live in a pig sty. Some programmers rise above ...

  1. #16
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Programming with Macros, great. What a mess. It's okay if you live in a pig sty. Some programmers rise above that though. Personally I don't think that Macros can accomplish what the STL can. It sounds like thin ice to me.
    Last edited by Troll_King; 08-16-2002 at 01:09 AM.

  2. #17
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Originally posted by swoopy
    >The thing that I find weird is that they think that their own libraries are more efficient than the STL. I have never seen anyone on this board who I believe is capable of this.

    What about you ? You might be capable.
    I don't pretend that I can write more efficient classes than the STL offers, that's why I use the STL.

  3. #18
    Registered User
    Join Date
    Jun 2002
    Posts
    151
    If all you need out of a container is the properties of a uni-directional linked list I would imagine a fair proportion of the people here could out-perform the (current) STL. However, if you need a generic set of containers that provide all of the functionality of the STL I doubt there's many (if any) that could.

    What's the moral of the story?

    Oh hell, I've forgotten.

  4. #19
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    If you need a uni-directional linked list than use a vector sequential container.

  5. #20
    Registered User
    Join Date
    Jun 2002
    Posts
    151
    If you needed the properties of a uni-directional list, std::vector would give you worse performance than std::list. Any array type container is going to have pretty horrendous insertion/deletion performance (comparatively speaking).

  6. #21
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    The Vector is strong if you just want to append values but not so good for instertion/deletion other than at the end because it invalidates the iterators that follow the instertion/deletion. The vector is better at randomly accessing values however. You just have to know the right container to use. These are sequential containers, there are also associative containers, which again have different strengths. I can see someone having performance problems with the STL if they are not using it properly, but not otherwise.

  7. #22
    Registered User Aran's Avatar
    Join Date
    Aug 2001
    Posts
    1,301
    I think it would be extremely helpful for peopl just getting into STL if those who are knowledgable dealing with it were to put their heads together and come up with a list of the libraries that they find most usefull, and what they are usefull for.

    ...it may be good faq board content.

  8. #23
    Nick
    Guest
    What make you people to jump to a conclusion that C++ programmers have never tried on using STL? It needs to be fair without bias and conservative when discussing about a programming language. For many years in software development, I have found that C++ STL is much slower than C macros, especially for develope the real-time apps. I totally agree with DV007 that STL is slow in speed such as real-time server, mission-critical embedded software....ect
    Probably is if you are doing some of the stuft with vector which
    could have easily done with just a dynamic array or a regular
    array. But if you need the functionality then use it. Another thing is that you have to enable full optimizations.

    Windows and the STL are not mutually exclusive. My game (see sig) runs in windows and uses the STL quite a bit.
    Mine uses the SDL. What you want to do is profile. I found out that most of the time was spend in drawing the entire tile background each frame using SDL_BlitSurface. But since SDL_BlitSurface uses clipping I was able to make drawing
    the tiles faster by using SDL_LowerBlit.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Find max profit among input salary
    By hlam in forum C Programming
    Replies: 8
    Last Post: 11-16-2008, 09:30 AM
  2. Programming for fun and profit
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 41
    Last Post: 12-16-2004, 03:52 PM
  3. Open Source and profit...
    By amzolt in forum C Programming
    Replies: 2
    Last Post: 03-28-2002, 08:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21