C++17 In Detail: Learn the Exciting Features of The New C++ Standard!
Book information
Description
C++17 is a major update to the language and brings many exciting additions and improvements that will change your pre for the better. This book shows you all of the significant changes in the new Standard. I spent hundreds of hours investigating how the new features work to ensure this book is helpful and practical. It will not only save you time but will guide you through lots of nuances of the language and the Standard Library. Among the dozens of C++17’s enhancements described in the book, you will learn about the following: Class Template Argument Deduction Structured Bindings Fold Expressions Inline Variables Parallel AlgorithmsPolymorphic Allocatorstd::anystd::byte std::filesystemstd::from_chars std::optionalstd::string_viewstd::variant[[nodiscard]]if constexpr If you have experience with C++11/14 and you want to advance to the latest C++ Standard, then pick up the book and start reading. “If you’ve ever asked ‘what’s in C++17 and what does it mean for me and my pre?’ — and I hope you have — then this book is for you.” Herb Sutter The book is also available as ebook @Leanpub: https://leanpub.com/cpp17indetail Table of Contents About the Author Technical Reviewer Additional Reviewers & Supporters Revision History Preface About the Book Who This Book is For Overall Structure of the Book Reader Feedback Example Code Part 1 - The Language Features Quick Start Fixes and Deprecation Removed Things Fixes Compiler support Language Clarification Stricter Expression Evaluation Order Guaranteed Copy Elision Dynamic Memory Allocation for Over-Aligned Data Exception Specifications as Part of the Type System Compiler Support General Language Features Structured Binding Declarations Init Statement for if and switch Inline Variables constexpr Lambda Expressions Nested Namespaces Compiler support Templates Template Argument Deduction for Class Templates Fold Expressions if constexpr Declaring Non-Type Template Parameters With auto Other Changes Compiler Support Standard Attributes Why Do We Need Attributes? Before C++11 Attributes in C++11 and C++14 C++17 additions Section Summary Compiler support Part 2 - The Standard Library Changes std::optional Introduction std::optional Creation Returning std::optional Accessing The Stored Value std::optional Operations Examples of std::optional Performance & Memory Consideration Migration from boost::optional Special case: optional and optional Summary Compiler Support std::variant The Basics std::variant Creation Changing the Values Accessing the Stored Value Visitors for std::variant Other std::variant Operations Exception Safety Guarantees Performance & Memory Considerations Migration From boost::variant Examples of std::variant Wrap Up Compiler Support std::any The Basics std::any Creation Changing the Value Accessing The Stored Value Performance & Memory Considerations Migration from boost::any Examples of std::any Wrap Up Compiler Support std::string_view The Basics The std::basic_string_view Type std::string_view Creation Other Operations Risks Using string_view Initializing string Members from string_view Handling Non-Null Terminated Strings Performance & Memory Considerations Migration from boost::string_ref and boost::string_view Examples Wrap Up String Conversions Elementary String Conversions Converting From Characters to Numbers: from_chars Converting Numbers into Characters: to_chars The Benchmark Summary Compiler support Searchers & String Matching Overview of String Matching Algorithms New Algorithms Available in C++17 Examples Summary Compiler support Filesystem Filesystem Overview Demo The Path Object The Directory Entry & Directory Iteration Supporting Functions Error Handling & File Races Examples Chapter Summary Compiler Support Parallel STL Algorithms Introduction Overview Execution Policies Algorithm Update New Algorithms Performance of Parallel Algorithms Examples Chapter Summary Compiler Support Other Changes In The Library std::byte Improvements for Maps and Sets Return Type of Emplace Methods Sampling Algorithms New Mathematical Functions Shared Pointers and Arrays Non-member size(), data() and empty() constexpr Additions to the Standard Library std::scoped_lock std::iterator Is Deprecated Polymorphic Allocator, pmr Compiler support Part 3 - More Examples and Use Cases Refactoring with std::optional and std::variant The Use Case The Tuple Version A Separate Structure With std::optional With std::variant Wrap up Enforcing Code Contracts With [[nodiscard]] Introduction Where Can It Be Used? How to Ignore [[nodiscard]] Before C++17 Summary Replacing enable_if with if constexpr - Factory with Variable Arguments The Problem Before C++17 With if constexpr Summary How to Parallelise CSV Reader Introduction and Requirements The Serial Version Using Parallel Algorithms Wrap up & Discussion Appendix A - Compiler Support GCC Clang VisualStudio - MSVC Compiler Support of C++17 Features Appendix B - Resources and References
Similar books
C++ Lambda Story. Everything you need to know about Lambda Expressions in Modern C++!
2021 · PDF
C++ Initialization Story. A Guide Through All Initialization Options and Related C++ Areas
2022 · PDF
C++ Initialization Story: A Guide Through All Initialization Options and Related C++ Areas
2022 · PDF
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF