C++11 Rocks - GCC Edition
C++11 Rocks - GCC Edition
About the Book
I dedicated hundreds of hours to research, and compiled all the relevant information into a single book. My book is laser-focused on the language changes made in C++11 and implemented by the GCC compiler (versions 4.8.1 and above, which have full C++11 support). You’ll quickly get in-depth knowledge required to use the latest C++ features in your projects.
I wrote the book for experienced C++ developers. It has tons of examples, detailed explanations, and no fluff.
Almost any project will benefit from using C++11 language features. These are the main advantages:
- Better performance
- Improved abstractions
- Less boilerplate code
- More type safety
Both GCC and Clang support all of C++11 language features, and Visual Studio has substantial support as well, making C++11 a viable choice whether you're doing cross-platform or GCC only development.
- The book does *not* cover the library changes introduced in the C++11 standard.
- The code samples are formatted for the landscape orientation of the Kindle.
Here are a few quotes from the readers:
"It’s exactly what I needed: I’m a seasoned C++ veterean who’s been working with Java since mid-2010. So what I needed is mainly an “in-depth update” on all the new stuff that came with C++ 11, and I don’t have the time (or the inclination) to read all through Stroustrup’s 4th edition. And your book just fits that bill :-)" - Philipp Leibfried
"What I like about the C++11 Rocks book is that its relatively short, getting right to the new new C++11 material. Despite this, it includes just the right amount of background material in a couple places that really need it. It’s a very well balanced book." - Tony Di Croce
"I was looking for a good way to get introduced to C++11 – and quickly. Your book has been very helpful. Coming from C++03 I both needed a detailed explanation of the new features and also a good insight into the new way of thinking about, and attacking, the problems I was faced with.
I loved the good price and the quick access to the book. I also like the fact the book is still in development and you are active on twitter – it really gives a face to the author. I also dig the idea that it targets subsystems like gcc and Visual Studio. Thanks man!" - Mads Ravn
"I picked up a copy of Alex’s book, and he has done some amazing work! For those of you who find yourself short on time, but need to know what’s new and keep current this book has it all. It’s a great time saver, and the organization of the material makes it a great companion reference.
It covers template changes, the new class features including the changes related to constructors and inheritance, and the changes made for Unicode support and defining custom suffixes in C++11. It also covers concurrency and the use of thread-local variables. I haven’t finished it all, but it is well worth the small investment for the work he has summarized!" - Jay D. Campbell
- C++11 guiding principles
decltype- how about both at once?
- Why do we need this thing?
- Return type
- Lambda parameters
- Lambda body
- Storing lambdas
std::functionto the rescue
- References to outside context
- Capturing in C++11
- Capturing by reference
- Default capture modes
- Capturing class members
- Limitations of capturing
- Mutable lambdas
- Conversion to function pointers, nested lambdas, recursion
- How not to shoot yourself in the foot
- Rules of thumb for lambdas
- Lambda syntax in all its glory
- Variadic templates
- Template aliases
- Closing angle brackets are officially allowed to tail-gate
- Local and unnamed types as template arguments
- Default values for function template parameters
- Arbitrary expressions in template deduction contexts
- In-class initializers for non-static data members
- Inheriting constructors
- Delegating constructors
- Default methods
- Deleted methods
- Extended friend declarations
- Nested class access rights
The Dream of Uniform Initialization
- Embrace the braces
- Narrowing conversions
- Distortions of the uniformity continuum
Want a move-only type in your
- Surprising consequences of narrowing
- What’s the verdict?
- What are the benefits?
- How does this stuff work?
- Revision part 1: lvalue vs. rvalue
- Revision part 2: const attribute + lvalue/rvalue
- Revision part 3: reference initialization
- Rvalue references
- Overload resolution
- Implementing move semantics
- Compiler generated move operations
- Implementing your own move operations
- Moving it right
- Reference qualifiers for member functions
- Move-only types
Perfect Forwarding Problem and Solution
- Reference collapsing and rvalues in templates
Bonus: implementation of
- What else is it good for?
- What’s in a constant expression?
- Literal types
A couple more notes on
What’s the advantage over
- What’s the advantage over
- Specifying the underlying type
- Forward declaration
- Compile Time Assertions
- Unicode support and literals
- Unicode character literals
- Raw literals
- User defined literals
- Types of literals
- Literal operators for integers
- Character and string literal operators
noexceptfor your own functions
When to use
A couple more notes on
- Explicit Conversion Operators
Why not just add a
- Why not just add a
sizeofApplied to Non-static Data Members
- Multi-threading related semantics
Thread local storage
- Thread local initialization
- Thread local destruction
- Standard attributes
POD Types, Trivial Types, and Standard Layout Types
- Trivial classes
- Trivially copyable classes
- Trivial operations
- Standard layout types and classes
Changed restrictions on
- Discriminated unions
- C99 Compatibility Features
- Deprecated and Removed Features
- Writing Cross-Platform Code
- Return type deduction for functions
- Generic lambdas
- Extended capturing in lambdas
Revised restrictions on
- More language changes
- Beyond C++14
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.