C++11 Rocks - GCC Edition
$7.99
Minimum price
$9.00
Suggested price

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.

Please note: 

- 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

About the Author

Alex S. Korban
Alex S. Korban

Alex Korban has been crafting software for over 12 years, and has been advocating the use of modern C++, STL and Boost for a long time. He has worked for a range of companies, from web startups to a US multinational, and on a variety of C++ projects including a flight simulator, geospatial applications, computer controlled bulldozer blades, and even software driven kerb laying machines. He also runs cpprocks.com, a resource for developers which focuses on C++11 and C++14.

Table of Contents

  • Introduction
    • C++11 guiding principles
  • Type Inference
    • auto
    • decltype
    • auto, decltype - how about both at once?
  • Lambda Expressions
    • Why do we need this thing?
    • Return type
    • Lambda parameters
    • Lambda body
    • Storing lambdas
    • std::function to the rescue
    • References to outside context
    • Closures
    • 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
  • Template Features
    • Variadic templates
    • Template aliases
    • Using using instead of typedef
    • Closing angle brackets are officially allowed to tail-gate
    • Local and unnamed types as template arguments
    • extern templates
    • Default values for function template parameters
    • Arbitrary expressions in template deduction contexts
  • Class Features
    • In-class initializers for non-static data members
    • Inheriting constructors
    • Delegating constructors
    • Default methods
    • Deleted methods
    • override and final
    • Extended friend declarations
    • Nested class access rights
  • The Dream of Uniform Initialization
    • Embrace the braces
    • initializer_list
    • Narrowing conversions
    • Distortions of the uniformity continuum
    • Want a move-only type in your vector?
    • auto + {}
    • <> + {} = ?
    • Surprising consequences of narrowing
    • What’s the verdict?
  • Move Semantics
    • 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
    • std::move
    • Moving it right
    • Reference qualifiers for member functions
    • Move-only types
  • Perfect Forwarding Problem and Solution
    • Reference collapsing and rvalues in templates
    • How the forward template works
    • Bonus: implementation of std::move
  • constexpr Mechanism
    • What else is it good for?
    • What’s in a constant expression?
    • constexpr variables
    • const and constexpr
    • constexpr functions
    • Literal types
    • A couple more notes on constexpr functions
  • Range-based for Loop
  • nullptr
    • What’s the advantage over NULL?
  • enum Changes
    • Scoped enums
    • Specifying the underlying type
    • Forward declaration
  • Compile Time Assertions
  • Literals
    • Unicode support and literals
    • Unicode character literals
    • Raw literals
    • User defined literals
    • Types of literals
    • Literal operators for integers
    • Character and string literal operators
  • noexcept
    • noexcept for your own functions
    • noexcept operator
    • When to use noexcept
    • A couple more notes on noexcept
  • Explicit Conversion Operators
  • Inline Namespaces
    • Why not just add a using statement?
  • Alignment
    • alignof
    • alignas
  • sizeof Applied to Non-static Data Members
  • Memory Model
    • Multi-threading related semantics
  • Thread local storage
    • Thread local initialization
    • Thread local destruction
  • Attributes
    • 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 unions
    • Discriminated unions
  • C99 Compatibility Features
  • Deprecated and Removed Features
  • Writing Cross-Platform Code
  • C++14
    • Return type deduction for functions
    • Generic lambdas
    • Extended capturing in lambdas
    • Revised restrictions on constexpr functions
    • constexpr variable templates
    • More language changes
    • Beyond C++14
  • Conclusion

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.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

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 $13 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.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub