Good book/resource to learn "effective" template programming in C++? [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I saw Scott Meyers' "Effective C++" third edition book having a small section on "Template Programming".
Any other book/links containing information on "effective" usage of templates ?

I like Modern C++ Design: Generic Programming and Design Patterns Applied. I found it very well written and clear. Contains a few advanced topics.

Vandevoorde / Josuttis 'C++ Templates the Complete Guide' is very accessible.

C++ Templates - The Complete Guide. Alexandrescu's Modern C++ Design is very good, but I wouldn't recommend it unless you're already familiar with templates. It's also geared more to C++ Framework creators.

I quite like C++ Template Metaprogramming by Abrahams and Gurtovoy.

Scott Meyers deals with the Standard Template Library in Effective STL. That may be relevant for you.

A rarely mentioned but solid book is C++ Common Knowledge by Stephen C. Dewhurst. "Among the first users of C++ at Bell Labs", Dewhurst gives the book a somewhat deceptive title because he actually covers quite a bit of advanced material in particular in regards to templates.
Dewhurst's book is organized similarly to Meyers's with 63 "Items" that you can usefully read on their own. On templates you should look over items 45-59 (about 70 pages of reading).

Related

Does reading a c++ 11 book requires to have knowledge of c++98? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am currently reading a C++ book written in 2000 which basically means is using c++ 98.(correct me if I am wrong)
My question is, reading a c++11 book like this one (https://rads.stackoverflow.com/amzn/click/0321563840) which most of the users suggest, requires me to have read already a c++98 book?
C++11 is not a separate language. It's just a new version of the existing one. Reading a C++11 book requires whatever prior knowledge that the C++11 book says it requires.
Bjarne's new version of "The C++ Programming Language" expects no prior knowledge of anything. Some other books will expect prior knowledge.
Actually, given the changes from C++98 to C++11, I'd recommend not reading an old book beforehand.
This is because a lot of old methods and idioms have been replaces with much neater constructs and features, which avoid many pitfalls and issues that C++ programmers had to contend with earlier. A coarse comparison would be to read up on relays and electron/vacuum tubes in order to, eventually, understand how to build transistor based logic. No need to start at that end.
So, I recommend you want to read on what's current, then it wouldn't hurt to read an older book to understand why a lot of already existing C++ code was written like it was.
If it's an "what's new in C++11", then you obviously need to know C++98 beforehand.
But as #Nicol says, the book should declare what previous requirements it has.

Any good C++0x overviews? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I teach C and C++ and I was just wondering if there are good overview of the C++0x features.
I am going to read the standard, but that will take time and I'm definitely going to make it for this semester (next year hopefully). For this semester I just want to make one extra lecture about C++0x (and maybe make sure that none of the taught features are deprecated/changed in C++0x).
The best two I know of are the Wikipedia page and Stroustrup's FAQ.
I really wouldn't recommend reading the standard until you know what you're looking for. Besides being significantly larger than the C++03 standard, the organization and clarity has gotten somewhat worse in parts.
If you're only going to do one lecture on "advanced C++", you might focus on C++0x features which were adopted from other common sources, such as boost::smart_ptr and std::tr1::unordered_map. Such things are ahead of the curve on adoption.
Herb Sutter has written many articles on the changes which you might find useful.
Wikipedia has a long overview. I would hightlight rvalue references and lambdas.
There is a lot of overviews C++0x in a network. I can recommended to read a wiki page, and C++0x FAQ
I've been reading this Code Project overview:
Explicating the new C++ standard (C++0x), and its implementation in VC10
The C++ Annotations have everything available in gcc 4.4. This is a (free) book rather an overview.
Scott Meyers has a 3-day course titled "An Overview of the New C++ (C++0x)", and perhaps more interestingly, a ~335 page, $30 PDF with all the course notes (if you can't spare the time or money for the course).
I know the time & cost of the course might be prohibitive, but the PDF might be an option.

c++ / object-oriented quick review? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am looking for quick reference guide(s) for both OO and C++. I have a few technical interviews coming up and I just want a quick reference that gives the basic overview of the fundamentals. (Nothing too in depth, as I've learned it all once before)
Have a look at this C++ tutorial online.
There is also Bruce Eckel's Thinking In C++ freely available book.
C++ FAQ Lite is searchable and Herb Sutter's Guru Of The Week series feature many tricky puzzles.
Steve Yegge at google has a couple of excellent summaries of interview questions here and here.
Here's a site that's dedicated to Object Oriented Programming in C++. It provides quick coverage of the basic concepts.
For pure OO info, you might want to review the basic terminology (not C++ related) on Wikipedia's Object-oriented design page.
Stroustrup's FAQ is a good jumping off point to refresh some things. For a terminology refresher it's hard to beat the OO Wiki page.

C++ tutorial for experienced C programmer [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been programming exclusively in C for 25 years but have never used C++. I now need to learn the basics of C++ programming. Can anyone recommend an online tutorial (or failing that a book) that would be most suitable for me.
Thanks.
Edit: I actually needed the C++ purely for the purposes of adding a couple of dirty hacks to a huge and old C program. Converting the entire program in to properly written OO code is entirely economically unfeasible. Some people have criticized the suggested solutions based on the fact that they will lead me down the path of becoming a "C programmer who knows some C++ without getting in to the proper spirit of C++" - but actually that fits my requirements perfectly.
Edit: The link in the top voted answer seems to be broken right now but the file appears to exist in multiple places - e.g. here.
This might be of some use: C++ tutorial for C users.
If you're looking for a book, check out "C++ for C Programmers" by Ira Pohl (Amazon).
I found Thinking in C++ very good when I was going from C to C++.
Link broken - can now be found here
I'd like to suggest the New C++ Super-FAQ created by Bjarne Stroustrup, Herb Sutter, Andrei Alexandrescu, Pearson / Addison-Wesley Publishers and Marshall Cline (http://www.parashift.com/c++-faq/).
If you can get hold of a 2nd edition of Scott Meyer's "Effective C++", that should help, as it was written for former C developers. It lists 50 rules that you should follow which are easily to remember, thoroughly explained, and fun to read. (Scott's goal was to write the "best 2nd C++ book" one should read an I think he succeeded in that.)
The 3rd edition of the book was completely overhauled and targets developers coming from C#, Java etc. more than earlier editions. It might be good read nevertheless.
Accelerated C++ is good too.
This very recent SO question asked by an inexperienced C programmer nevertheless has answers that are also relevant to experienced C programmers.
If you're already a good C programmer, you can probably jump right into the bible, Stroustrup's The C++ Programming Language.

Where can I learn more about C++0x? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I would like to learn more about C++0x. What are some good references and resources? Has anyone written a good book on the subject yet?
ISO C++ committee
Bjarne Stroustrup
Especially his C++0x FAQ
The Design of C++0x (pdf) from C/C++ Users Journal, May 2005
Wikipedia's C++0x article
G++'s experimental support for C++0x with the -std=c++0x switch
SO's c++0x tag
Articles on
Lambda Expressions,
The Type Traits Library,
The rvalue Reference,
Concepts,
Variadic Templates,
shared_ptr
Regular Expressions
Tuples
Multi Threading
General Discussion
The C/C++ Users Journal,
The New C++,
Article
Videos
Google tech talk
overview of various features
overview at wikipedia
Library
Boost
Herb Sutter's blog, He posts new developments in C++0x and links to detailed references
Bjarne Stroustrup's Website
Both are ISO-C++ standards committee members. Herb Sutter will posts an update on each meeting that he attends.
Working Draft, Standard for Programming
Language C++
Wikipedia article seems like an excellent starting point: C++0x
It provides a good summary with brief examples and is updated regularly to match latest additions.
Here are two videos on the subject. They are a bit old, but still very relevant:
New Features in the Next C++ Standard ( http://www.youtube.com/watch?v=ZAG5txfYnW4 ) and Advanced Topics in Programming Languages Series: C++ Threads
There is a ton of stuff on this very site - some of the posts include very informative discussion. I would point you to Google but it's going to be more efficient to search in C++0x tagged posts here imo.
Here's a good one to start with, which includes indirection to Stroustrup's own summary. Scott Meyers has presentation materials on the topic here.
Check up on your favourite compiler's support for the new version. Microsoft VC10 support is summarized here. GCC info can be found here.
Official state of the standard for the language is available here. Evolution of the language is in many places tied to ongoing work in Boost. See here for some info on that.
Honestly my preference these days is to look here for 99% of needed info rather than resort to a book.
You may refer Presentation Materials: Overview of the New C++ (C++0x) by Scott Meyers.