Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm something of a new, reluctant convert to C++ from a Pascal, Ruby, and PHP background. I haven't worked with Pascal since a few months of torture with "Delphi Turbo;" since then I've practically been eating and sleeping Ruby and PHP. I'm already well acquainted with object oriented programming and many various subjects.
My main trouble is that I already know the rudiments of C/C++ programming, less the actual experience of working with C++. I worked with C for long enough to realize that even without macros, etc, I didn't want to work with it. (Some of the disgust was from maintaining a CGI application in C, when accustomed to Pascal's automatic string management.) I know just enough C++ to be dangerous to myself and anyone else unwitting enough to use my "code."
I'd really like to work up to a good enough understanding of C++ to use libraries like Crypto++ and Boost without major problems or in-depth knowledge of the language's intricacies. I just need to figure out how to work with C++ without killing myself (either with C++, or with the long-standing dislike that I'm already battling).
What are effective resources that will teach me C++ without assuming that I must be retaught all basic programming? I'd rather not relearn concepts that I already know, unless the paradigm in C++ is significantly different. I'm also learning on my own time, so don't recommend me a book complex enough to need a guru to explain to me, please! And I have an effective budget of $0 for learning C++, so please keep suggestions to quality online resources or books common enough that I could likely find them at the library.
Read Effective C++ by Scott Meyers - it's a good guide for getting past the basics of C++ and showing how to write and use "correct" C++ code
The C++ FAQ Lite is a great resource.
I highly recommend Stroustrup: The C++ Programming Language (Third Edition). As the author of C++ he is the authority on the language, and the book is useful as a reference as much as it is for learning the language. It's common enough that most good general purpose libraries will have a copy. He goes into quite some depth on all the features of C++, including explanations of why certain design decisions were made in the language. Personally, I think this is the best book around for programmers to learn C++.
Once you have a good grip on core C++, David Abrahams and Aleksey Gurtovoy's book, C++ Template Metaprogramming, goes into further depth and provides many examples of how C++'s template system allows you to perform complex compile-time programming, a highly valuable skill these days. This one is a little less common but you can probably find it at a university library.
I can give you a couple of keywords you might want to research in more detail:
RAII (Is pretty much the technique that ensures you don't have to worry about memory leaks. Very convenient)
Generic Programming (The STL in particular. Experiment with iterators and the standard library algorithms, and see just how powerful these abstractions are. They're a key part of what I like about C++)
Functors (Perhaps too simple on their own, but the way they can be used instead of function pointers with the algorithms mentioned above is interesting)
And just get familiar with templates, and "mild" forms of template metaprogramming. (Traits classes, for example, and (partial) specializations.
And just keep an eye on the C++ questions here on SO. A lot of interesting topics are regularly brought up.
But the best advice is probably to keep it completely separate from C. Forget everything you learned about how to use C. It either doesn't apply in C++, or leads to inferior code that is harder to read and maintain.
It's an interesting language in its own right, and has a number of unique features. Leverage those, and it can actually be fun to work with C++. Treat it as an overengineered Java, PHP or C, and it'll just make you want to throw up.
You need to write code. A lot of code in C++. There is no substitute. You also need to read good code.
I agree with the suggestion for Scott Meyers' books though. Those are pretty good.
Part of your learning will be the leap from procedural programming to OO.
I would highly recommend the book "C++ Common Knowledge" by Stephen C. Dewhurst. Don't know if it's common enough to be found at the library (it's not at mine, but my library sucks for computer books that aren't 5-10 years out of date), but it does an excellent job of taking the complex aspects of C++ and making them easy to understand, without dumbing anything down for beginners. Definitely worth the investment.
To quote from the back of the book:
This book is for you if
You're no "dummy," and you need to get quickly up to speed in intermediate to advanced C++
You've had some experience in C++ programming, but reading intermediate and advanced C++ books is slow-going
You've had an introductory C++ course, but you've found that you still can't follow your colleagues when they're describing their C++ designs and code
You're an experienced C or Java programmer, but you don't yet have the experience to develop nuanced C++ code and designs
You're a C++ expert, and you're looking for an alternative to answering the same questions from your less-experienced colleagues over and over again
C++ Common Knowledge covers essential
but commonly misunderstood topics in
C++ programming and design while
filtering out needless complexity in
the discussion of each topic. What
remains is a clear distillation of the
essentials required for production C++
programming, presented in the author's
trademark incisive, engaging style.
Here is a link to a question with answers that should help you.
https://stackoverflow.com/questions/1227764/i-need-to-improve-my-c-skills-fast-is-this-realistically-possible/1227805#1227805
For effective stuff you can find online Cplusplus.com has a pretty good reference and information.
If you can find the book "C++ Common Knowledge" (Stephen Dewhurst) at the library or cheaply online, I would add that to the list posted on the StackOverflow link above as well as "The C++ Programming Language" (Stroustrup). Going through the questions under the C++ tag right here on SO should give you some good pointers and code examples to get you on your way.
Here's a list of good C++ books which teach you C++ rather than basics of programming.
Sit down and write some C++ code.
Related
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
C++ tutorial for experienced C programmer.
I program in a number of languages frequently and have been using C++ lately. Basically my classes are just wrappers around pure C code. Almost like a struct with associated methods. This gives me the encapsulation and privacy that I want for my data. I have a small hierarchy of classes and am just barely using inheritance.
I am familiar with OO concepts and know what search terms to use when i need to find out about a particular concept in this regard. However, as I have discovered in my foray in the programming world, often the language features that are really helpful are hidden to the newcomer or novice, and the useful bits that I need have already been written and are in a library somewhere that is freely available (most times part of the framework - like in .NET).
What path would you suggest to gain this vital knowledge in C++ and stop myself reinventing the wheel (poorly).
This is the wrong way to use C++. You would be better served grabbing a copy of Accelerated C++ and reading it. Yes, it's a beginner book but unless you want to continue treating C++ as just C with objects then you need to focus on how C++ programmers do things instead of just sticking with what you already know. You need to start from the beginning and build a good foundation in C++.
Learn the STL if you're going to really plan to use C++ in the future. Though opinions will vary widely, particularly among the die-hards, I think there is absolutely no problem using C++ as "C with objects."
Boost is also pretty awesome.
EDIT: Note the downvotes already coming in from the die-hards. C++ acolytes really don't like to hear people advocate using the language as "C with objects." I stand by my statement. You can write quite shippable and commercially viable code without going crazy with an RTTI-enabled, templatized, multiply-inherited set of classes. Remember KISS.
Scott Meyers' books are a great place for C programer to begin with C++.
I recommend Thinking In C++ by Bruce Eckle. Normally it's available for free online, or as a book.
I suggest you read the books:
"C++ Coding Standards: 101 Rules, Guidelines and Best Practices" --Sutter & Alexandrescu
"Modern C++ Design: Generic Programming and Design Patterns Applied" --Alexandrescu
And probably anything else by Andrei Alexandrescu that you can get your hands on.
Then, there are a number of design patterns and programming idioms that make it very clear why "C with objects" is extremely reductionist. Just to name a few: RAII (Resource Allocation Is Initialization), PImpl (or Cheshire Cat), Factory functions, Smart Pointers, Singleton, Type Traits, Expression Templates, etc. When you know about these, you are no longer programming in C++, but in ++C (because you get a result that actually reflects the increment over C).
As for not reinventing the wheel, like many have said already, make sure to first explore the possibilities in the Standard Template Library (STL) (which is much richer than you might think) and then look at Boost (www.boost.org) which has libraries for a lot of diverse purposes and they are extremely high quality (and some are just works of art, like Spirit, Proto, Lambda and MPL). After that, there is of course a large amount of open-source software in C++ out there, but use it with caution: sometimes it is better to reinvent a wheel that fits perfectly to your application than to use one that might not be appropriate or powerful enough, or worse, full of bugs!
I suggest the book The C++ Programming Language for filling in the gaps in your basic C++ knowledge, and BOOST as the first place to look for existing libraries supporting your programming.
Have you thought about getting the C++ Primer Plus? It's a really good book.
The C++ Standard Library: A Tutorial and Reference
Read Meyers for specific tips, but also Stroustrup's Design and Evolution. The latter gets into the motivation as to why C++ is what it is, and very much comes from a "how to improve C" viewpoint.
As for "The C++ Programming Language", 3rd edition is very long. If you can find the 2nd edition, its much more digestible, although of course occasionally out of date (but mostly just less complete).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm a Perl5 programmer for 7 years and I'm trying to learn C++ now.
Some of the C++ syntax is hard for me to understand and to think in C++ way.
For example:
In Perl, you can mix the data in the arrays
#array = (1,"string",5.355);
You can assign any value to a scalar variable:
$var = 1;
$var = "string";
$var = \$reference_to_scalar;
There are many examples.
A friend of mine recommend me the book "Thinking of C++" by Bruce Eckel, but I haven't any C background and it's hard for me to understand some things.
So my question is - could you recommend me a book for this situation. I don't want to learn C. I understand OOP (I'm getting more familiar with C++ oop aswell), I understand the point of the pointers (and some arithmetic) and references (widely used in Perl).
I don't need manuals for dummies (what is int, bool, double, if, while), I just need a direction how to learn C++ from the perspective of a Perl programmer, because I'm sure that there are many like me.
Thank you in advance.
EDIT: Thank you for all the recommended books and the answers, I will try with "Accelerated C++". I will start from the beginning and try to change my mindflow to C++. I have added the "beginner" tag.
"C++ For Perl Programmers" is a pretty specific request. Given that Perl abstracts away more of the machine than C++ does, I think that a good way to start would be to forget what you know about Perl and get a regular C++ book.
For example, it seems reasonable to you that you should be allowed to have multiple data types in an array, because a Perl array is a higher-level construct than just a series of contiguous words in memory. If I were going to go from an array in C++ to one in Perl, I would say that a Perl array is like a C++ array that holds pointers to data instead of data (if that is even true - I am not a Perl programmer so it may not be. Maybe a Perl array is more like a linked list data structure. In any case, you get the idea.) Going backwards, IMO, is not quite the same.
As far as the book I'd recommend - there are a lot of good ones, so it depends on the style and depth you're looking for. I think Accelerated C++ is great for ramping up - its thorough and covers a lot of ground without inundating you with the tedious details.
Don't bother with learning C unless you want to know C. Programming in C++ is nothing at all like programming in C. I realize most books and teachers claim otherwise, but they're wrong. You should be looking for the exceptions, such as the previously mentioned, "Accelerated C++."
You won't find any books that will help you write code like the code you've just shown. Perl is a very weakly typed language and C++ is exactly the opposite: a strongly typed language. There are, however, ways to get kind of what you're showing in your post in various boost constructs such as variant and tuple.
I would suggest though learning C++ as a totally independent language before stepping into that kind of thing. Don't learn C++ as a Perl Programmer, learn it as a complete newb. You may be bored with the first few chapters but in the end you'll have a better grasp of the style and powers unique to C++ vs. those unique to Perl. I haven't seen any "Xlanguage for Ylanguage" book that will get you there.
I've gone through the opposite process. One of the first things I learned was that while you can write Perl code that looks like C or C++, you shouldn't. The same goes for you. You can probably find a way to write Perl-ish C++ code, but don't bother. The languages are too different. You need to learn how to write C++ code as a C++ programmer. Several goods books have already been suggested. I think you should augment that by finding a mentor. You'll get immediate feedback if you're doing things the right or wrong way. You can also check out the C++ FAQ Lite, especially chapters 28 and 29 on issues for new C++ programmers.
The biggest difference is that C++ is strongly typed. Every variable has a type, and it doesn't change. Your example Perl code is technically possible in C++, but it requires an extra library that I'm not sure you're ready for yet. Instead, the C++ way is to think about a collection of mixed but related items as their own new type - a struct or class.
Another great option is to post specific C++ questions here on SO. We encourage beginner-level questions as long as they're clearly worded and show some prior effort.
I tried to learn C++ from the "Thinking in C++" book. I found it very, very hard to learn from.
A much better book for someone starting in C++ is "Accelerated C++: Practical Programming by Example" by Andrew Koenig and Barbara E. Moo
I second Thinking In C++. I read it after knowing perl, and I found it very good. The second edition doesn't assume C knowledge; here's what it says under Prerequisites in the Preface:
In the first edition of this book, I
decided to assume that someone else
had taught you C and that you have at
least a reading level of comfort with
it. My primary focus was on
simplifying what I found difficult:
the C++ language. In this edition I
have added a chapter that is a rapid
introduction to C, along with the
Thinking in C seminar-on-CD, but I am
still assuming that you already have
some kind of programming experience.
In addition, just as you learn many
new words intuitively by seeing them
in context in a novel, it’s possible
to learn a great deal about C from the
context in which it is used in the
rest of the book.
As danben said, you pretty much just need to "forget what you know about perl". It's useful to know perl just because it's another programming language (C-like, even), but it's nowhere near similar enough to just "learn the differences".
Also: Thinking In C++ is free for the electronic version.
I work with Perl exclusively for my day job and program C++ for fun on nights and weekends. They require totally different mind sets. You're better off approaching C++ as a noob programmer and learn it from 'Hello World' on up. Sure you can fast track over general concepts such data types, but still pay enough attention to know your short from your long and your reference from your pointer.
I would avoid learning C first unless you really need to know C. Character handling in C is a pain and not suited for what I suspect you want to do. The String class in C++ is your friend: learn it, live it love it!
Actually, since you already know an imperative language, learning C won't take you much time at all. The basics are all the same -- if statements, while loops, for loops etc. Even the way the namespaces are organized are similar (although the guts of course are different.) You might want to gloss over some of the pointer handling, as C++ does references a little differently, but you would not be doing yourself any harm by picking up and reading through a copy of K&R (the official C reference) at least once. (Every decent programmer should have a copy on his bookshelf as a reference, anyway.)
After that, pick up a recent edition of Stroustrup and have at it, ensuring that you work through the exercises. Some of the concepts may be a little foreign to a Perl-oriented mind, but it won't be too strange. If you encounter a particular concept you find tricky, post again on SO and there will be lots of people happy to go through it with you!
(source: wikimedia.org)
(source: att.com)
My university recommended us this book : http://www.lrde.epita.fr/~akim/ccmp/assignments.html#C_002b_002b-Primer
Anyway, Thinking in C++ is available on the web for free. You could find the link on the previous link I gave you.
Good luck :)
Here you can find a vast variety of free downloadable/online books.
The Stroustrup book is a little hard when learning the language, its better to try another book and use the Stroustrup book as a reference.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
HI all.
I have started a new job recently where I am supposed to work with C++/ I have been doing programming in C language for past 5 years. I am looking for ways to get me up to an acceptable level in OOP. I have all the basic concepts of C++ and OOP but don't have much experience of actual class designing.
What I really am looking for is ways to learn class library designing as I will be working in a team who is writing C++ libraries for other programmers to use. Please suggest principles like "responsibility assignment" which can help me design classes in general.
Give a loook to Bob Martin SOLID principles:
SRP The Single Responsibility Principle: A class should have one,
and only one, reason to change.
OCP The Open Closed Principle: You should be able to extend a classes
behavior, without modifying it.
LSP The Liskov Substitution Principle: Derived classes must be
substitutable for their base classes.
ISP The Interface Segregation Principle: Make fine grained
interfaces that are client specific.
DIP The Dependency Inversion Principle: Depend on abstractions, not
on concretions.
I know this isn't the type of answer you've been looking for; it's more like a extension of the other answers (already done and yet to come). I thought I'd add some general stuff...
Write one class declaration per .hpp file, one class definition per .cpp file. Name files like the class they contain. (It's surprising and frustrating to find how much code doesn't get this basic rule right.)
Be aware that C++ is a multi-paradigm language. Some things are better solved without a class hierachy. (Some things call for templates, some things are best done in good old procedural style.)
Learn about the Boost libraries, and how they do things. They're a good showcase of well-done C++, especially on the user interface side. And they are useful in your everyday work, too.
Read "Effective C++", "More Effective C++" and "Effective STL" by Scott Meyers. If in doubt, just get the first, and you'll find out why you should read the other two yourself.
Couldn't resist giving these basics, seeing a newcomer to the language that actually asks for advice before getting into lots of bad habits. ;-)
There are a number of posts here on SO dealing with this, for instance:
What is the best source to learn C++?
A good C++ book
In general, Scott Meyers books are a good place to start.
Books by Andrei Alexandrescu are also very good.
I still like Bjarne Stroustrup's book. It has several chapters devoted to design and it's also a great language reference. It can be pretty dense reading at times, but it's worth the effort.
I found C++ to be a great tool, but only after I really learned how to use it. Read all the references suggested here by others, and there's no substitute for practice!
The SOLID principles are good guides, but don't forget that you have to have concrete use cases if you are going to be able to do good OOD. If you are designing a class (for other programmers) to inherit from, you need at least three concrete (and as different/realistic as possible) cases where you actually inherit from the class, or you will not be able to see how the classes should work.
Try designing everything in UML before you code using proper sequence of diagrams down to class and sequence. Despite all (rightly) criticisms of UML, it will force you to treat program as a system of interacting objects and not sequence of code.
Most of "principles of OOP" are easily reduced to absurdity if you try to design program following them exactly. Refactoring is another story.
Otherwise, make sure you really know C++ and STL. Good or bad, STL is what is expected in C++ code.
Designing C++ class hierarchies for others to use is a minefield. I would highly recommend reading up on some of the common pitfalls in class design. Two books I suggest:
C++ Coding Standards (Herb Sutter & Andrei Alexandrescu). Packed full of concrete examples of how to create proper classes in an easy to understand way.
Effective C++ (Scott Mayers). How to write correct C++, starting from the transition from C to C++. A classic.
Refer this link. This pdf consists of "Design Principles and
Design Patterns"
http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf
The above link will help u a lot.
Depending on how STL oriented your new job is, you'll either get praised, or shot, for reading: Modern C++ Design by Alexandrescu.
Even if you don't use any of the patterns in it, it will open a new world of C++ to you.
I'd put that book second on your reading list, after some Meyers books. Alexandrescu is pretty... intense.
It takes a few years to become proficient in C++. The books that have been suggested will help. I also suggest that you read Herb Sutter's Exceptional C++ series.
For the short term, you should find a C++ mentor to help you get up to speed in the new company. Each company has its own "culture" around C++. Dos and don'ts. This may be more relevant to your job than what you read. For example, your company may not use STL, so learning it may turn out be just an academic exercise. Many companies practice "Cargo Cult" programming - in this case, avoiding powerful but scary features of the language - so you may find you're frustrated that you can't use what you learn from the books.
It's hard for me to imagine trying to learn a language as complex as C++ just for the job. Reading all those books and practicing takes time. You can learn what you need for the job, and make a useful contribution. I think you have to love it to become proficient.
You should read Tony Albrecht's Pitfalls of Object Oriented Programming.
I recently started working with C++ too, and this is what I did:
First, I got the book C++ In Action from a coworker, and went through its 'Language' part, doing all the exercises. The 'Techniques' chapter is also an important one.
Then, the thing that helped me the most, I think, is reading a lot of my team's already written code and trying to understand the reason for everything in it. If your team members know how to code well, this is quite educating. And anyway, it definitely helps you understand the purpose and methods of your project, and what's expected of you.
Reading part the project's code might be something you'd have to do anyway, I believe (in order to use library functions, implement similar functions, or add to existing code), but sometimes people skip that part or do it very superficially.
Some background: My job involves maintaining a large multi-threaded multi-process C++ / C# application, and so I'm often tasked with understanding access violations, memory leaks, heap curruption issues and the like.
I quite enjoy this, and I've amassed quite a good understanding of various low level concepts, but the trouble is that I don't program in C++, and aside for the purposes of maintenance I don't really intend to.
What I mean by that is that if I ever need to develop something then at the company I work at the best choice is C# (more developers, other apps also in C# means better interops), so its not that I don't program in C++, it's just that whenever I do program in C++ it will be purely for the purpose of learning C++, and so I want to get the most out of it.
My view is that "Teach yourself C++" books and the like aren't very suitable as they focus too much on getting things done - there are usually many ways of doing things and so they tend to pick one method, so when I'm presented with some code that does things a different way I'm stuffed (e.g. a book teaches MFC, I then get presented with some ATL code and the book hasn't even taught me what ATL and MFC are, let alone how to recognise that what I'm looking at is different!)
I'm really looking for teach yourself C++, with the emphasis on understanding other peoples code.
IMHO C++ in particular is a language that you cannot learn by reading a "teach yourself" book, you really need to have several sources and one of these is actually to look at other people's code.
I would recommend reading Effective C++ and More Effective C++ by Scott Meyers to learn some of the pitfalls when programming in C++, it is a good way to learn especially when you are looking at people's code. Another site than can help is gotw as well, some excellent information is there as well.
Since you'll never be creating C++ programs from scratch, I recommend you narrow your vision and just look at the applications you will be supporting, concentrating on the things you do not fully understand and tackling them one-by-one.
I find http://www.parashift.com/c++-faq-lite/ to be a good basic resource for C++. When dealing with specific technologies like MFC or ATL, do some research beforehand on which book(s) will suit you best. My favorite method: a strong coffee, a comfy chair and a pile of candidate books at Barnes & Noble to review. Focused on-line searching will suffice as well.
There are no shortcuts to knowledge and mastery, but by limiting your focus you can save yourself some wasted effort. Generally speaking, the more complex the technology--or the more fundamental the design screw up--the more you need to know to fix it. It's the facts of life!
The C++ FAQ is a great source of information.
Despite others' answers, I don't think your problems will lie mainly with the language. Sure, you can look at the standard or Stroustrup, but these will only teach you language constructs.
Most of what you will have trouble learning, I imagine, will be windows-specific and whateverplatformyouareusing-specific.
Do read stroustrup and other language guides, but be prepared to delve into the docs for the libraries and systems you are using.
It sounds like you really need a copy of the C++ standard. (ISO/IEC 14882 - available in draft form for free online. the final version costs a few bucks)
Of course, Stroustrup's book would be a good choice too. But in general, focus on material that describes the language, rather than, as you say, "how to get things done".
If you're having to maintain C++ code that uses MFC and/or ATL to a large degree then the best way to learn how it works so that you are able to properly maintain the code is to write small applications that use MFC and/or ATL so that you get an understanding of hwta is going on when the code is run. Reading a book by Stroustrup will not help you in any way to understand MFC and/or ATL. The other thing you should probably be focusing on is how COM works since ATL is basically a framework of templates, macros, etc that makes using COM easier.
Hope that helps.
I've studied C++ as a college course. And I have been working on it for last three years. So I kinda have a fairly good idea what is it about. But I believe to know a language is quite different from using it to full potential. My current job doesn't allow me to explore much.
I have seen you guys suggest studying a open source project and perhaps contributing to one too. So my question is, can you suggest one(of both?) to start with that is simple and doesn't overwhelm a starter.
I was in the same situation 12 years ago when I got my first programming job out of college. I didn't do any open source but I managed to gain a lot of practical and advanced C++ knowledge by reading books (the dead tree kind).
In particular, there was an excellent series by Scott Meyers which I feel helped the most in turning me from newbie to professional:
Effective C++: 55 Specific Ways to Improve Your Programs and Designs
More Effective C++: 35 New Ways to Improve Your Programs and Designs
Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
The topics in these books range from beginner to advanced. It took me about 2 years working in C++ to understand every chapter in these books, so don't be disheartened if it goes over your head at some point... just try reading it again later :)
If you're willing to climb the very steep learning curve, I would think that you could do worse than studying parts of the boost libraries. I don't think there is another similar body of C++ code out there that is pushing the boundaries of what can be done in C++.
re project selection: you'll want to hack on something that has some relevance to you, otherwise it's just unpaid work. i might suggest eg. Pure, but will you find enough interest?
re advanced code: see Boost
Obviously learning something like this does not happen overnight; You can study existing open-source projects like other posters suggested. However, I have one more suggestion: I suggest joining one of the big IRC c++ channels (for example #c++ on efnet or freenode). Of course most of the questions / discussions going there are basic; however quite often interesting discussions and questions come up. Over the several years I've learned quite a bit just by participating in channel discussions.
My main advice would be that you do not need to stick to C++ to learn technique.. Study Erlang, Lua, and Haskell (lots of others). You will learn so much from these language that you can apply in C++.
Google protocol buffers is a very well written C++ application that sticks to the features of C++ that are proven in the industry -- i.e., they don't go over the top with features that cause headaches for using the code.
In terms of learning to use C++ to its full potential, well the full potential is often hidden. There are very few exceptional C++ programmers, even in the open-source community. So I suggest you read some books. Like the books from Scot Myers and Herb Sutter (all 6 of em).
Boost is an amazing library and has a lot of good code, ranging from simple techniques to very advanced techniques. It definitely touches all of the bleeding edge of C++ idioms. The problem with boost is, it doesn't work well with modern IDE features (code-completion being the main problem), and it has a LOT of symbols :D. It is the place to learn about generic programming and template meta-programming, the former represents the most advanced and immediately-usable idioms, and the latter you can skip for the immediate future.
Apart from the Scott Meyers books DSO has already suggested: Participate on SO and try to answer other people's C++ questions. If you don't know the answer, wait a little until some good answers are posted. You will probably get some idea where the gaps in your knowledge are and you could do some more reading to fill those afterwards.