C++20 STL Cookbook: Leverage the latest features of the STL to solve real-world problems (Paperback)

Weinman, Bill

  • 出版商: Packt Publishing
  • 出版日期: 2022-05-27
  • 售價: $1,780
  • 貴賓價: 9.5$1,691
  • 語言: 英文
  • 頁數: 450
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1803248718
  • ISBN-13: 9781803248714
  • 相關分類: C++ 程式語言
  • 立即出貨 (庫存=1)




Key Features

  • Become familiar with the latest features of C++20 and write better code using the STL
  • Reduce the development time for your applications and enable faster deployment
  • Get up and running with the new and leaner STL capabilities introduced in the latest release

Book Description

Fast, efficient, and flexible, the C++ programming language has come a long way and is used in every area of the industry to solve many problems. The latest version C++20 will see programmers change the way they code as it brings a whole array of features enabling the quick deployment of applications. This book will get you up and running with using the STL in the best way possible.

Beginning with new language features in C++20, this book will help you understand the language's mechanics and library features and offer insights into how they work. Unlike other books, the C++20 STL Cookbook takes an implementation-specific, problem-solution approach that will help you overcome hurdles quickly. You'll learn core STL concepts, such as containers, algorithms, utility classes, lambda expressions, iterators, and more, while working on real-world recipes. This book is a reference guide for using the C++ STL with its latest capabilities and exploring the cutting-edge features in functional programming and lambda expressions.

By the end of the book C++20 book, you'll be able to leverage the latest C++ features and save time and effort while solving tasks elegantly using the STL.

What you will learn

  • Understand the new language features and the problems they can solve
  • Implement generic features of the STL with practical examples
  • Understand standard support classes for concurrency and synchronization
  • Perform efficient memory management using the STL
  • Implement seamless formatting using std::format
  • Work with strings the STL way instead of handcrafting C-style code

Who this book is for

This book is for intermediate to advanced C++ programmers who want to get the most out of the Standard Template Library of C++20, the newest version of C++. Basic knowledge of coding and C++ concepts is necessary to get started with this book.



  • 熟悉 C++20 的最新功能,並使用 STL 撰寫更好的程式碼

  • 減少應用程式開發時間,實現更快的部署

  • 瞭解最新版本中引入的更簡潔的 STL 功能,並開始使用


快速、高效且靈活的 C++ 程式語言已經發展了很長一段時間,並且在各個行業的各個領域中被用於解決許多問題。最新版本的 C++20 將使程式設計師改變他們的編碼方式,因為它帶來了一系列功能,使應用程式能夠快速部署。本書將以最佳方式讓您開始使用 STL。

從 C++20 的新語言功能開始,本書將幫助您瞭解語言的機制和庫功能,並提供有關它們如何工作的見解。與其他書籍不同,C++20 STL Cookbook 採用了一種特定於實現的問題解決方法,可以幫助您快速克服障礙。在實際的示例中,您將學習核心 STL 概念,例如容器、算法、實用類、lambda 表達式、迭代器等。本書是使用 C++ STL 的參考指南,介紹了其最新功能,並探索了功能編程和 lambda 表達式的尖端特性。

通過閱讀本書,您將能夠充分利用最新的 C++ 功能,並使用 STL 以優雅的方式解決任務,從而節省時間和精力。


  • 瞭解新的語言功能及其可以解決的問題

  • 通過實際示例實現 STL 的通用功能

  • 瞭解用於並發和同步的標準支援類

  • 使用 STL 進行高效的記憶體管理

  • 使用 std::format 實現無縫格式化

  • 以 STL 的方式處理字串,而不是手工編寫 C 風格的程式碼


本書適合中高級 C++ 程式設計師,他們希望充分利用 C++20 的標準模板庫,這是 C++ 的最新版本。開始閱讀本書需要具備編碼和 C++ 概念的基本知識。


Bill Weinman has been involved in technology since he built his first computer at age 16, in 1971. He’s been coding in C and C++ since the early 1970s. He’s written systems and applications for major clients, including NASA, Bank of America, Xerox, IBM, and the US Navy. Also an electronics engineer, he worked on the Voyager II spacecraft, audio amplifiers for SAE, and sound systems for Altec Lansing.

Since the mid-1990s, Mr. Weinman has focused on writing and teaching. His books and courses cover HTML, SQL, CGI, Python, and of course, C and C++. An early contributor to online learning, his clear, concise writing has made his courses a popular feature on lynda and LinkedIn Learning.


Bill Weinman自1971年16歲時建造了他的第一台電腦以來,一直參與科技領域。他從20世紀70年代初開始使用C和C++進行編程。他曾為包括NASA、美國銀行、施樂、IBM和美國海軍在內的重要客戶編寫系統和應用程序。作為一名電子工程師,他曾參與Voyager II太空船、SAE音頻放大器和Altec Lansing音響系統的開發。

自1990年代中期以來,Weinman先生專注於寫作和教學。他的書籍和課程涵蓋HTML、SQL、CGI、Python,當然還有C和C++。作為線上學習的早期貢獻者,他清晰、簡潔的寫作風格使他的課程成為lynda和LinkedIn Learning上的熱門選項。


Table of Contents

  1. New C++20 Features
  2. General STL Features
  3. STL Containers
  4. Compatible Iterators
  5. Lambda Expressions
  6. STL Algorithms
  7. Strings, Streams, and Formatting
  8. Utility Classes
  9. Concurrency and Parallelism
  10. Using the File System
  11. A Few More Ideas



  1. C++20的新功能

  2. STL的一般功能

  3. STL容器

  4. 相容的迭代器

  5. Lambda表達式

  6. STL算法

  7. 字串、串流和格式化

  8. 實用類別

  9. 並行和平行處理

  10. 使用檔案系統

  11. 更多的想法