Learn more
These promotions will be applied to this item:
Some promotions may be combined; others are not eligible to be combined with other offers. For details, please see the Terms & Conditions associated with these promotions.
- Highlight, take notes, and search in the book
- In this edition, page numbers are just like the physical edition
Your Memberships & Subscriptions

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Modern C++ Programming Cookbook: Master Modern C++ with comprehensive solutions for C++23 and all previous standards 3rd Edition, Kindle Edition
Meta Description: With a wealth of practical recipes, this third edition isn't just a guide to C++23; it's a complete resource covering key features and techniques from C++11 through to C++23. It's designed to keep you ahead of the curve in C++.
Key Features
- Updated and packed with new recipes, including sync streams, std:expected and std:mdspan, and C++20/23 range adaptors
- Covers all significant features from all modern versions of the standard, providing comprehensive insights into modern C++
- Learn through a series of hands-on, self-contained recipes
- Purchase of the print or Kindle book includes a free eBook in PDF format
Book Description
The updated third edition of Modern C++ Programming Cookbook addresses the latest features of C++23, such as the stacktrace library, std::expected and std::mdspan classes, the header, formatting library improvements, and updates to the ranges library. It also gets into more C++20 topics not previously covered, such as sync streams and source_location.
The book is organized into practical recipes covering a wide range of real-world problems, helping you find the solutions you need quickly. You’ll find coverage of all the core concepts of modern C++ programming and features and techniques from C++11 through to C++23, meaning you’ll stay ahead of the curve by learning to incorporate the newest language and library improvements.
Beyond the core concepts and new features, you’ll explore recipes related to performance and best practices, how to implement useful patterns and idioms, like pimpl, named parameter, attorney-client, and the factory pattern, and how to complete unit testing with the widely used C++ libraries: Boost.Test, Google Test, and Catch2.
With the comprehensive coverage this C++ programming guide offers, by the end of the book you’ll have everything you need to build performant, scalable, and efficient applications in C++.
What you will learn
- Explore the new C++23 language and library features
- Go deep into the most useful C++20 features
- Learn to handle threading and concurrency for better performance
- Solve complex string manipulation tasks efficiently with regex
- Leverage the standard library for faster development
- Master the filesystem library to work with files and directories
- Work with different types of strings and understand compilation
- See how you can use CRTP, mixins and other patterns in C++
Who this book is for
This book is designed for entry- and intermediate-level programmers who already have a foundational understanding of the C++ programming language, but who are looking to master the language, implement the newest features, and become proficient modern C++ developers. Experienced C++ programmers can leverage the recipes in this book to quickly get up to speed on all the most important language and library features of C++11/14/17/20 and 23.
Table of Contents
- Learning Modern Core Language Features
- Working with Numbers and Strings
- Exploring Functions
- Preprocessing and Compilation
- Standard Library Containers, Algorithms, and Iterators
- General-Purpose Utilities
- Working with Files and Streams
- Leveraging Threading and Concurrency
- Robustness and Performance
- Implementing Patterns and Idioms
- Exploring Testing Frameworks
- C++23 Features
- ISBN-13978-1835084847
- Edition3rd
- PublisherPackt Publishing
- Publication dateFebruary 29, 2024
- LanguageEnglish
- File size4.5 MB
See all supported devices
Kindle E-Readers
- Kindle
- Kindle Paperwhite
- Kindle Paperwhite (12th Generation)
- Kindle Oasis (9th Generation)
- All new Kindle paperwhite
- Kindle Paperwhite (5th Generation)
- Kindle Scribe, 1st generation (2024 release)
- Kindle (10th Generation)
- All New Kindle E-reader
- All New Kindle E-reader (11th Generation)
- Kindle Scribe (1st Generation)
- Kindle Voyage
- Kindle (11th Generation, 2024 Release)
- Kindle Paperwhite (10th Generation)
- Kindle Touch
- Kindle Oasis (10th Generation)
- Kindle Paperwhite (11th Generation)
- Kindle Oasis
Fire Tablets
- Fire HD 8 (8th Generation)
- Fire 7 (9th Generation)
- Fire HD 10 (9th Generation)
- Fire HD 8 (10th Generation)
- Fire HD 10 Plus
- Fire 7 (12th Generation)
- Fire HD 10 (11th Generation)
- Fire HD 8 Plus
- Fire HD 8 (12th Generation)
Free Kindle Reading Apps
- Kindle for Android Tablets
- Kindle for Android Phones
- Kindle for iPad
- Kindle for iPhone
- Kindle for PC
- Kindle for Web
- Kindle for Mac
Customers who bought this item also bought
From the brand

-
See Our Full Range
-
Packt is a leading publisher of technical learning content with the ability to publish books on emerging tech faster than any other.
Our mission is to increase the shared value of deep tech knowledge by helping tech pros put software to work.
We help the most interesting minds and ground-breaking creators on the planet distill and share the working knowledge of their peers.
From the Publisher


What’s changed in C++ since the last edition of this book came out, and what’s changed in the book to help developers work with those changes?
The second edition of the book was published in late 2020. Since then, a new version of the standard has been developed. Although it will only be finally published in 2024, this version is known as C++23. Perhaps not a version as large as C++20, C++23 still offers a multitude of improvements and new features, both for the language and the standard library. In the new edition, readers can look forward to learning about span buffers, the stack trace library, the std::mdspan type, the std::expected type, and the multidimensional subscript operator. All of these and more are covered across 15 new and updated recipes. With a total of 23 new recipes and other improved ones, this edition explores the latest version of the standard but also includes more C++20 topics not previously covered.

C++ programming is a very broad subject, how did you decide which topics to cover and what to leave out?
Indeed, C++ is a multi-paradigm programming language with many features. It comes with a standard library that allows developers to use out-of-the box utilities (without resorting to third-party libraries or reinventing the wheel). The selection of topics was made to include all the important areas that developers come across, such as handling of strings and numeric types, lambdas and function templates, compilation, containers, algorithms, iterators, files and streams, time and dates, threads and synchronization mechanisms, and many other topics. Moreover, I also included a selection of patterns and idioms, as well as several unit testing frameworks to help developers learn not only how to write code but also how to ensure it does the right thing.

What was your aim when creating this book, and what will readers be able to do once they’ve read it?
When I started with this book 7 years ago, I wanted to present a different approach to teaching C++, with an emphasis on the new, modern way of using the language. I wanted it to be simple to read but to cover a broad range of topics of varying complexity, both for beginners and more experienced C++ programmers. With the second and third edition, the focus was on covering the new, at the time, C++20 and C++23 standards, respectively.
After finishing this book, readers will be able to master the language in all its areas and write high-quality C++ code. Moreover, in the third edition, I am particularly excited to share the recipes covering std::expected, std::mdspan, and std::optional types in chapter 6, as well as several new ones covering the ranges library from chapter 12.

How does your book stand out from all the other C++ books out there?
The idea of a cookbook is to present developers with recipes that propose solutions to challenges that they regularly face. This book is a collection of over 150 such recipes that cover a multitude of topics and solutions using language and library features from C++11/14/17/20/23. The updates in the second and the third edition are focused on the C++20 and C++23 standards, respectively. Developers can not only use the book as a reference to many of the modern C++ language and library features but also as a guide to solving various programming tasks.
Editorial Reviews
Review
“Modern C++ Programming Cookbook, Third Edition, is a solid book with many tips and topics that are useful for your everyday C++ coding. Marius is a great author with many C++ books - all written very well. This is an update to the second edition and has a ton of useful information for beginners and experts. The info in this book will help you write modern C++ code and take advantage of the newest C++23 features. I'd highly recommend this book for going over the various technical details so you can start using contemporary C++ today!”
Yacob (Kobi) Cohen Arazi, Software Engineer, NVIDIA, Organizer, San Diego C++ Meetup
About the Author
Marius Bancila is a software engineer with two decades of experience in developing solutions for line of business applications and more. He is the author of The Modern C++ Challenge and Template Metaprogramming with C++. He works as a software architect and is focused on Microsoft technologies, mainly developing desktop applications with C++ and C#. He is passionate about sharing his technical expertise with others and, for that reason, he has been recognized as a Microsoft MVP for C++ and later developer technologies since 2006. Marius lives in Romania and is active in various online communities.
"Product details
- ASIN : B0CLRSRWFL
- Publisher : Packt Publishing
- Accessibility : Learn more
- Publication date : February 29, 2024
- Edition : 3rd
- Language : English
- File size : 4.5 MB
- Screen Reader : Supported
- Enhanced typesetting : Enabled
- X-Ray : Not Enabled
- Word Wise : Not Enabled
- Print length : 818 pages
- ISBN-13 : 978-1835084847
- Page Flip : Enabled
- Best Sellers Rank: #409,502 in Kindle Store (See Top 100 in Kindle Store)
- #15 in C++ Programming Language
- #31 in Open Source Programming
- #37 in C++ Programming
- Customer Reviews:
About the author

Marius Bancila is a software engineer with 20 years of experience in developing solutions for line of business applications and more. He is the author of Modern C++ Programming Cookbook and Modern C++ Challenge. He focuses on Microsoft technologies and mainly develops desktop applications with C++ and C#, although over time he has worked with other technologies, such as Javascript, HTML/CSS, or Java. Marius is passionate about sharing his technical expertise with others, and for that reason, he was recognized as a Microsoft MVP since 2006. Marius has written many articles, has created and contributed to various open source projects and is active on various online developer communities. He can be contacted on Twitter at @mariusbancila.
Customer reviews
- 5 star4 star3 star2 star1 star5 star69%20%0%0%11%69%
- 5 star4 star3 star2 star1 star4 star69%20%0%0%11%20%
- 5 star4 star3 star2 star1 star3 star69%20%0%0%11%0%
- 5 star4 star3 star2 star1 star2 star69%20%0%0%11%0%
- 5 star4 star3 star2 star1 star1 star69%20%0%0%11%11%
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on April 11, 2024Format: KindleVerified PurchaseI picked this up because I needed to work with a c++ codebase. I picked up some good tricks while I was working my way through the codebase that I needed to update. I highly recommend this resource for c++ developers who want to learn some new tricks and maybe even refresh themselves with modern techniques in c++.
- Reviewed in the United States on March 5, 2024Format: PaperbackMarius Bancila's "Modern C++ Programming Cookbook, Third Edition," published by Packt Publishing in February 2024, caters to entry- to medium-level C++ developers seeking to refine their skills in modern C++. Boasting over 140 practical recipes, this book provides an in-depth exploration of contemporary C++ features and standard libraries, establishing itself as a critical tool for aspiring proficient modern C++ developers. Bancila, with his vast experience and eagerness to impart knowledge, offers priceless insights in this thorough guide.
The cookbook unfolds across 12 chapters, each packed with recipes that span from foundational language syntax to sophisticated features and libraries. Adopting a systematic format, each recipe begins with a "Getting Ready" section to lay the groundwork, followed by "How to do it" with step-by-step instructions, "How it works" to demystify the underlying principles, and "See also" for further resources and related discussions. This structured methodology not only provides practical solutions but also deepens the reader's comprehension of modern C++ principles and applications.
The comprehensive coverage extends to modern core language elements, practical applications like handling numbers and strings, and advanced topics such as concurrency and robustness, including the latest C++20 core features. Despite its extensive scope, the book maintains accessibility through the 'introduce, present, and describe' method, effectively simplifying complex concepts. This approach, coupled with real-world applications for each recipe, ensures the content is both understandable and applicable, enriching the learning experience and facilitating the integration of these concepts into practical scenarios.
However, it's noteworthy that specific areas such as graphics programming, network programming, or integration with other languages and technologies are not covered. This focus allows for a more concentrated exploration of core modern C++ features and practices.
The "See Also" sections further enhance the learning journey by offering additional insights and connecting to related recipes throughout the book, encouraging readers to explore topics of interest in a non-linear manner. In an age where digital resources are readily available, this book distinguishes itself by providing a dependable, offline resource of human-curated and tested scripts, confirming its status as a reliable resource amidst the occasional inaccuracies of AI-generated content.
In summary, "Modern C++ Programming Cookbook, Third Edition" by Marius Bancila is a meticulously crafted guide that skillfully bridges theoretical knowledge with practical application in modern C++ development. It stands as an indispensable resource for developers striving to navigate the complexities of modern C++ with assurance and proficiency, deserving a rating of 4.5 out of 5 for its comprehensiveness, practicality, and reliability as both a learning tool and reference in the field of modern C++ development.
- Reviewed in the United States on November 5, 2024Format: PaperbackThis book is a great opportunity for someone like me who’s been writing C-Style-C++ the same way for years to catch up with what’s new in more modern versions of the language. I should note that this is not an introduction to C++. It’s written with those already familiar with C++ in mind.
I’m a fan of these cookbooks because they are very practical and make for great reference books, and this is no exception. You’ll find a combination of recipes and detailed explanations that make the material suitable for all C++ developers.
I encourage you to check the table of contents to see the breadth of topics covered, but as a summary, it covers core language features, improvements to the STL, general-purpose utilities, concurrency, testing, and much more.
Overall, I really enjoyed this journey discovering what I’ve missed in modern C++ and recommend it if you’re looking to do the same.
- Reviewed in the United States on July 15, 2024Format: PaperbackI think the first thing that you need to think about when you're buying this book is the name - Modern C++ Programming Cookbook. That's exactly what it is, it's full of "recipes" explain and show how to use a specific feature of C++. Would you buy a cookbook to read cover to cover? Well, maybe, but probably not right? If you're aware of that going in, this is a great reference. Very beginner friendly as it covers things as basic as vectors, range based for loops, and auto. But it also covers more complex features like variant, optional, and span. There are chapters on threading, patterns, and testing frameworks, and even a section dedicated to C++20 modules. Again, this is a cookbook, so as others have stated, the format is pretty consistent in the following order for each topic: "Getting ready", "How to do it...", "How it works...", "There's more...", and "See also". This is repeated for basically every topic. This isn't necessarily a bad thing, this is a cookbook after all. The book has a good index, use it, find the information you need, apply it, and move onto the next topic. If a cookbook for C++ is what you're after, this is it.