14 Replies - 2096 Views - Last Post: 07 July 2011 - 02:46 PM Rate Topic: -----

#1 atwal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 27-February 11

Book for standard template library c++ according to current style ?

Posted 06 July 2011 - 01:41 PM

Hi Everyone
Please Could anyone suggest me a good book for standard template library c++.
I looked lots of books and many are good but they all are old style and due to change in coding style i could not get too much from these book.
plese can you suggest me any good book accoding to current coding style.
Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Book for standard template library c++ according to current style ?

#2 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Book for standard template library c++ according to current style ?

Posted 06 July 2011 - 02:26 PM

Well I don't know what you mean by "old style" -- books like

The C++ standard library: a tutorial and handbook By Nicolai M. Josuttis

or Generic programming and the STL

SHould demonstrate modern C++/STL

Now if you want something covering C++0x and STL you will have to wait until the standard is finalized/approved/stamped/typo-check/i-dotted/t's-crossed etc.

As far as I know there are no books that currently cover C++0x. There might be a few that hint at it or have a chapter on "what to expect" but until it is released publishers arn't going to risk it (the C++ standard committee is notorious for changing things just when everyone thinks it settled.)
Was This Post Helpful? 2
  • +
  • -

#3 jimblumberg   User is offline

  • member icon

Reputation: 5810
  • View blog
  • Posts: 17,740
  • Joined: 25-December 09

Re: Book for standard template library c++ according to current style ?

Posted 06 July 2011 - 04:05 PM

I concur with the Josuttis book. In my opinion it really explains the STL and has very good examples on how the classes are used.

Jim
Was This Post Helpful? 0
  • +
  • -

#4 atwal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 27-February 11

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 12:09 AM

the meaning from old style is that many books published before 2004 and most of very good accoding to that time coding stander. But compare to that time and now there is many changes in coding style. For example if we take Vector stl. There is many difference in coding for that. Thats why i am looking for such a book which is accoding to current stander.
I could not find any book which published in last 2-3 years.
Thanks
Was This Post Helpful? 0
  • +
  • -

#5 atwal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 27-February 11

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 12:42 AM

i found this book http://www.artima.co..._of_the_new_cpp may be you can find something from here.
Was This Post Helpful? 0
  • +
  • -

#6 PlasticineGuy   User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 01:03 AM

C++ has not changed in the past 10 years. There is a new standard, but it has not been finalised yet. Any books from the past 9 to 10 years should still be accurate.
Was This Post Helpful? 0
  • +
  • -

#7 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 06:11 AM

To be honest I am still not sure what you mean by "old style" as I am not really aware of any major changes before C++0x but it is true that many "advances" have been made over the last few years. Projects such as Boost have really changed C++ and you will find many techniques such as the use of lambdas and smart pointers that are not really documented in many books.

But as far as I know that is exactly it -- you will not find this stuff documented in any books really. And you probably will not for a couple of more years. The big reason being that the new standard has not finished it's "standardization" process and no compilers currently completely support the new standard -- and some got a little burned by supporting things that were ultimately dropped -- it is a dangerous business betting on what the standards committee will eventually come to consensus on.

So I don't know if you will really find what you are looking for. Most decent books published in C++ in the last few years have been on parallel/concurrent programming outside of that the two books I listed above are very good references to STL and might not really discuss the use of lambdas but they do discuss the philosophy behind STL and how to effectively use it.

As for the newest features (which are not expected to be published until next year (making C++0X become C++11)) you can expect to see some books on it coming out within the next year - and then probably picking up speed after that.

So, what to do?


The most recent book published on STL (as far as I can tell) is Extended STL, Volume 1: Collections and Iterators published in 2007 and looking at it on SafariOnlineBooks I can see that he used C++03 as a reference unfortunately that means that the book is bound to cover things that are NOT part of the new standard (which changed a lot since 2003).

However this does seem to be a pretty good book covering a lot of the philosophy behind STL (at least the containers and iterators :) )
C++ Standard Library Practical Tips (2005) -- Still the "old style" since I don't really see anything in there that would not have been covered back in the early 2000's.

Data Structures and Algorithms in C++, Second Edition (pub 2011) -- I have been reading from this book recently - it is NOT an STL book, but it does actually give a lot of "under the covers" kind of detail in to the how-and-why of many of the STL containers. So far I have really enjoyed it.

Elements of Programming by Alexander Stepanov; Paul McJones (2009) - I have also been trying to read this book. Very dense and abstract and again nothing directly to do with STL (or even C++) but the author Alexander Stepanov is one of the minds behind STL. This book really goes into some of the theory of modern programming techniques and again is a lot of "how and why".

Basically though -- if you want the latest and greatest techniques you have to:

#1 Read blogs/forums/newsgroups -- i.e. keep up online.
#2 Read journals/publications -- i.e. take a trip to the library now and again and browse.
#3 Read CODE. Download the source code to an STL implementation from SGI or Apache.
#4 WRITE PROGRAMS -- the only real way to know what works and what does not is to get in there and try things out. Books don't teach you programming, and they can give you techniques but YOU need to learn how/when to use them. Programming is the only way to really learn.

--when you program, try to use STL to solve your problems rather than jumping on "write your own".

Not that "write your own" is not good -- but to learn STL you need to learn how to leverage STL and that means restricting yourself to playing within the rules. The more you use STL the more you will see the solutions.

You know the old expression: "When your a hammer everything looks like a nail"? -- When you really know a language or a library etc. it is really easy to spot how to solve the problem within the tools that you know.
Was This Post Helpful? 0
  • +
  • -

#8 kiwi_steve   User is offline

  • D.I.C Head

Reputation: 31
  • View blog
  • Posts: 109
  • Joined: 26-September 09

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 06:18 AM

Its not a book as such, but when I was doing my C++ course at uni it was my bible, I never closed it. Its like the Java API Docs but with code samples:
cplusplus.com
Was This Post Helpful? 0
  • +
  • -

#9 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 06:45 AM

Also if you really want to get an insight into modern C++ -- learn a functional language like scheme (or even just functional javascript like JQuery) -- a GREAT DEAL of modern C++ is based upon functional techniques. Learning something like Boost::Phoenix 2.0 is very alien to a classic C++ programmer.

While there is documentation for how to use Phoenix it will not help you see why/how/when to use it -- for that you need to learn a functional language and begin to see problems from a functional point of view which is not exactly easy to do with C++ which was never intended to BE a functional language.
Was This Post Helpful? 0
  • +
  • -

#10 atwal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 27-February 11

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 12:08 PM

Actually i am new to c++ programming and i am learing game programming. i was reading a book Sams teach yourself Game programming in 24 hours and this book is published in 2003.
In this book Vector class is used and it was compiled with old version of visual c++
That complied version is working properly but when i am using same source code in visual studio 2010.
It gives me to many errors in vector class. Thats why i am looking new techniques to solve this problem.
I search in many books and found some errors but i could not solve it properly.
One thing more as in game programming c++ is very main could you tell me any c++ magazine or any online resources so i can keep me up to date.
Thanks a lot for helping me so much

This post has been edited by atwal: 07 July 2011 - 12:20 PM

Was This Post Helpful? 0
  • +
  • -

#11 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 12:21 PM

could you please post the code and error and maybe we can help fix it.

Also try to avoid programming books of the form: "teach yourself X in Y hours".
Was This Post Helpful? 0
  • +
  • -

#12 atwal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 27-February 11

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 12:52 PM

Actually i am not from programming background and i started programming in last year with java.
i know this type of really not good but it help me to understand the process of game programming
i just study this book for getting to only general knowldge, now i am studing only good c++ books to go deep.
you can check these code from this link.

http://code-info.com...ad/SpaceOut.zip

here is one file GameEngine.cpp there was most problem.
i correct some problem in two methods Update and CleanupSprite.
First it was crashed at start up but now it is working but after some time when there is lots of enemy need to delete more sprite from vector it crashed.
Thanks for helping

This post has been edited by atwal: 07 July 2011 - 12:56 PM

Was This Post Helpful? 0
  • +
  • -

#13 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 01:23 PM

ok... vC2010 builds this with no error. Nothing I see in your code looks "old style" programming to me... Nor does it look like "new style" (whatever that may mean).

So I don't really understand. most books published within the last 10 years should be good for what you are doing.
Was This Post Helpful? 0
  • +
  • -

#14 atwal   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 27-February 11

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 02:10 PM

View PostNickDMax, on 07 July 2011 - 01:23 PM, said:

ok... vC2010 builds this with no error. Nothing I see in your code looks "old style" programming to me... Nor does it look like "new style" (whatever that may mean).

So I don't really understand. most books published within the last 10 years should be good for what you are doing.


there is no error at build time. Before chaning some codes when i debug and start the game and when any sprite was deleted it was giving the error. you can see this from same type of program
http://www.dreaminco...1&#entry1372642

after that i changed some codes and not there is no error at starting but after some time there is to many sprites and i need to delete to many sprite object then it give me error. otherwise now it is working fine.
Was This Post Helpful? 0
  • +
  • -

#15 vividexstance   User is offline

  • Tiocfaidh ár lá
  • member icon

Reputation: 794
  • View blog
  • Posts: 2,880
  • Joined: 31-December 10

Re: Book for standard template library c++ according to current style ?

Posted 07 July 2011 - 02:46 PM

It sounds like there's a problem with YOUR code, and not the code from the book. Like NickDMax said, post your code, and someone will help you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1