C plus plus:Modern C plus plus:Preface
From GDWiki
| This article or section uses first-person ("I" or "we") or second-person ("you") inappropriately. Please edit it to use a more formal tone. |
Modern C++ : Going Beyond "C with Classes"
- Preface
- std::vector
- RAII
- Containers
- Iterators
- Algorithms
- Functors
- Binders
- Storing Functors
- References
- Glossary
- Appendices
Contents |
[edit] Purpose
The goal for the original version of this tutorial series was to help readers get from C with Classes to true Modern C++, as the series's subtitle mentions. Hopefully by the time you're done you'll understand:
- Why std::vector is easier and no slower than new[]ing stuff yourself.
- How to use the new features to make your code shorter and easier to understand.
- How exceptions allow for tighter invariants and cleaner code.
- The elegant, consistent resource-handling model made possible by templates and destructors.
- And many other useful things.
Hopefully the update-by-committee will keep a flow between articles, but it might also have turned into a std::string-style inconsistent monolith.
[edit] Prerequisites
[edit] Syntax Knowledge
This is not an introductory tutorial. It will not teach how a for loop works, how to compile your program, or other basics. If you're looking for that, consider Koenig and Moo's excellent Accelerated C++ book. Another option is Lippman, Lajoie, and Moo's C++ Primer which makes fewer assumptions and is more detailed, but is more daunting and not nessesarily better.
Some appendices cover some of the less well known parts of the language, but even then it is still assumed that you understand the basics of programming, only that you're unfamiliar with some of C++'s more unique syntax.
[edit] A Good Compiler
With the exception of Boost, everything in the tutorials should be ISO Standard C++. I won't, however, shy away from the complex parts of the language that ancient compilers can't handle. Your life will be much easier with a modern compiler, and with GNU's g++ 4 and MS Visual Studio 2005 EE both currently free for download, there's no reason not to have one. Please do not use MS VC++ versions earlier than 7.1 or G++ versions earlier than 3.3. In particular, DO NOT use MSVC++6, which was made before the C++ standard was finalised and doesn't even have the contents of its header files in the right namespace, let alone support partial template specialisation. If you insist on the MSVC++6 IDE, at least try to use a better compiler with it.
[edit] Curiosity
Every detail is not spelled exhaustively. The rest is up to you. Using the concepts in your own programs will teach you more than any example or extensive list of functions would.
To make things easier, the first mention of a new class or function should be a link to Roguewave's excellent std::lib documentation. Consider bookmarking its indicies, both the one organized alphabetically and the one organized functionally. The alphabetic is a huge help if you're looking for something specific and the functional is a great way to find similar functions or classes if you know almost what you need.

