最新章節(jié)
- Summary
- Reporting disk usage
- Modifying the filesystem
- Recursive directory walking
- Walking directories with directory_iterator
- Statting files with directory_entry
品牌:中圖公司
上架時(shí)間:2021-07-08 09:22:05
出版社:Packt Publishing
本書數(shù)字版權(quán)由中圖公司提供,并由其授權(quán)上海閱文信息技術(shù)有限公司制作發(fā)行
- Summary 更新時(shí)間:2021-07-08 10:20:56
- Reporting disk usage
- Modifying the filesystem
- Recursive directory walking
- Walking directories with directory_iterator
- Statting files with directory_entry
- Operations on paths
- Representing paths in C++
- Filesystems and paths
- Throwing errors with std::system_error
- Error codes and error conditions
- Using <system_error>
- A very long note on error-reporting
- A note about namespaces
- Filesystem
- Summary
- Shuffling cards with std::shuffle
- Making weighted choices with discrete_distribution
- Generating populations with normal_distribution
- Rolling dice with uniform_int_distribution
- Dealing with distributions
- Filtering generator outputs with adaptors
- Pseudo-random bits with std::mt19937
- Truly random bits with std::random_device
- Dealing with generators
- Solving problems with <random>
- The problem with rand()
- Random numbers versus pseudo-random numbers
- Random Numbers
- Summary
- Obscure ECMAScript features and pitfalls
- Non-consuming constructs
- A primer on the ECMAScript regex grammar
- Using regular expressions for string replacement
- Iterating over multiple matches
- Converting submatches to data values
- Pulling submatches out of a match
- Matching and searching
- Reifying regular expressions into std::regex objects
- A note on backslash-escaping
- What are regular expressions?
- Regular Expressions
- Summary
- Reading a line or word at a time
- Converting strings to numbers
- Converting numbers to strings
- A note on locales
- Formatting with ostringstream
- Solving the sticky-manipulator problem
- Streaming and wrappers
- Streaming and manipulators
- The classical iostreams hierarchy
- Formatting with printf and snprintf
- Buffering in the standard C API
- Using the standard C API
- Using the POSIX API
- Buffering versus formatting
- The trouble with I/O in C++
- Iostreams
- Summary
- Propagating different allocators
- Propagating downwards with scoped_allocator_adaptor
- Making a container allocator-aware
- Setting the default memory resource
- Using the standard allocator types
- Sticking a container to a single memory resource
- Carrying metadata with fancy pointers
- The 500 hats of the standard allocator
- Allocating from a pool resource
- Using the standard memory resources
- Defining a heap with memory_resource
- Refresher - Interfaces versus concepts
- An allocator is a handle to a memory resource
- Allocators
- Summary
- Improving our thread pool's performance
- Building your own thread pool
- Thread exhaustion and std::async
- Identifying individual threads and the current thread
- Speaking of threads...
- The future of futures
- Packaging up tasks for later
- Promises about futures
- Waiting for a condition
- Downgrading a read-write lock
- Upgrading a read-write lock
- Special-purpose mutex types
- Always associate a mutex with its controlled data
- "Taking locks" the right way
- Taking turns with std::mutex
- Big atomics
- Doing complicated operations atomically
- Using std::atomic<T> for thread-safe accesses
- The problem with volatile
- Concurrency
- Summary
- Denoting un-special-ness with observer_ptr<T>
- A final warning
- The Curiously Recurring Template Pattern
- Talking about oneself with std::enable_shared_from_this
- Holding nullable handles with weak_ptr
- Don't double-manage!
- Reference counting with std::shared_ptr<T>
- Managing arrays with std::unique_ptr<T[]>
- Customizing the deletion callback
- Why C++ doesn't have the finally keyword
- Automatically managing memory with std::unique_ptr<T>
- Smart pointers never forget
- The origins of smart pointers
- Smart Pointers
- Summary
- std::function copyability and allocation
- Again with the type erasure: std::function
- std::any and copyability
- Type erasure in a nutshell
- std::any versus polymorphic class types
- Infinite alternatives with std::any
- Revisiting variant
- Delaying initialization with std::optional
- What about make_variant? and a note on value semantics
- Visiting variants
- Expressing alternatives with std::variant
- A note about named classes
- Manipulating tuple values
- Working with std::tuple
- C++11 and algebraic types
- Tagging reference types with reference_wrapper
- The story of std::string
- Vocabulary Types
- Summary
- Where does the memory come from?
- Load factor and bucket lists
- The hashes: std::unordered_set<T> and std::unordered_map<K V>
- Moving elements without moving them
- Oddballs: std::multiset<T> and std::multimap<K V>
- A note about transparent comparators
- The trees: std::set<T> and std::map<K V>
- The useful adaptor: std::priority_queue<T>
- Abstracting with std::stack<T> and std::queue<T>
- Roughing it with std::forward_list<T>
- What are the special skills of std::list?
- A particular set of skills: std::list<T>
- The speedy hybrid: std::deque<T>
- Pitfalls with non-noexcept move constructors
- Pitfalls with vector<bool>
- Inserting and erasing in a std::vector
- Resizing a std::vector
- The workhorse: std::vector<T>
- The simplest container: std::array<T N>
- The notion of ownership
- The Container Zoo
- Summary
- Deleting from a sorted array with std::remove_if
- Searching and inserting in a sorted array with std::lower_bound
- Merges and mergesort
- Heaps and heapsort
- Rotation and permutation
- Swapping reversing and partitioning
- Our first permutative algorithm: std::sort
- Algorithms that affect object lifetime
- Write-only range algorithms
- Complicated copying with std::transform
- Variations on a theme - std::move and std::move_iterator
- Shunting data with std::copy
- Read-only range algorithms
- A note about headers
- The Iterator-Pair Algorithms
- Summary
- The deprecated std::iterator
- Putting it all together
- Input and output iterators
- Iterator categories
- A pair of iterators defines a range
- Const iterators
- On beyond pointers
- The problem with integer indices
- Iterators and Ranges
- Summary
- Generic programming with templates
- Classically polymorphic functions
- Concrete monomorphic functions
- Classical Polymorphism and Generic Programming
- Questions
- Piracy
- Errata
- Downloading the example code
- Customer support
- Reader feedback
- Conventions
- Who this book is for
- What you need for this book
- What this book covers
- Preface
- Customer Feedback
- Why subscribe?
- www.PacktPub.com
- About the Reviewer
- About the Author
- Credits
- Mastering the C++17 STL
- Copyright
- Title Page
- coverpage
- coverpage
- Title Page
- Copyright
- Mastering the C++17 STL
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Why subscribe?
- Customer Feedback
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Errata
- Piracy
- Questions
- Classical Polymorphism and Generic Programming
- Concrete monomorphic functions
- Classically polymorphic functions
- Generic programming with templates
- Summary
- Iterators and Ranges
- The problem with integer indices
- On beyond pointers
- Const iterators
- A pair of iterators defines a range
- Iterator categories
- Input and output iterators
- Putting it all together
- The deprecated std::iterator
- Summary
- The Iterator-Pair Algorithms
- A note about headers
- Read-only range algorithms
- Shunting data with std::copy
- Variations on a theme - std::move and std::move_iterator
- Complicated copying with std::transform
- Write-only range algorithms
- Algorithms that affect object lifetime
- Our first permutative algorithm: std::sort
- Swapping reversing and partitioning
- Rotation and permutation
- Heaps and heapsort
- Merges and mergesort
- Searching and inserting in a sorted array with std::lower_bound
- Deleting from a sorted array with std::remove_if
- Summary
- The Container Zoo
- The notion of ownership
- The simplest container: std::array<T N>
- The workhorse: std::vector<T>
- Resizing a std::vector
- Inserting and erasing in a std::vector
- Pitfalls with vector<bool>
- Pitfalls with non-noexcept move constructors
- The speedy hybrid: std::deque<T>
- A particular set of skills: std::list<T>
- What are the special skills of std::list?
- Roughing it with std::forward_list<T>
- Abstracting with std::stack<T> and std::queue<T>
- The useful adaptor: std::priority_queue<T>
- The trees: std::set<T> and std::map<K V>
- A note about transparent comparators
- Oddballs: std::multiset<T> and std::multimap<K V>
- Moving elements without moving them
- The hashes: std::unordered_set<T> and std::unordered_map<K V>
- Load factor and bucket lists
- Where does the memory come from?
- Summary
- Vocabulary Types
- The story of std::string
- Tagging reference types with reference_wrapper
- C++11 and algebraic types
- Working with std::tuple
- Manipulating tuple values
- A note about named classes
- Expressing alternatives with std::variant
- Visiting variants
- What about make_variant? and a note on value semantics
- Delaying initialization with std::optional
- Revisiting variant
- Infinite alternatives with std::any
- std::any versus polymorphic class types
- Type erasure in a nutshell
- std::any and copyability
- Again with the type erasure: std::function
- std::function copyability and allocation
- Summary
- Smart Pointers
- The origins of smart pointers
- Smart pointers never forget
- Automatically managing memory with std::unique_ptr<T>
- Why C++ doesn't have the finally keyword
- Customizing the deletion callback
- Managing arrays with std::unique_ptr<T[]>
- Reference counting with std::shared_ptr<T>
- Don't double-manage!
- Holding nullable handles with weak_ptr
- Talking about oneself with std::enable_shared_from_this
- The Curiously Recurring Template Pattern
- A final warning
- Denoting un-special-ness with observer_ptr<T>
- Summary
- Concurrency
- The problem with volatile
- Using std::atomic<T> for thread-safe accesses
- Doing complicated operations atomically
- Big atomics
- Taking turns with std::mutex
- "Taking locks" the right way
- Always associate a mutex with its controlled data
- Special-purpose mutex types
- Upgrading a read-write lock
- Downgrading a read-write lock
- Waiting for a condition
- Promises about futures
- Packaging up tasks for later
- The future of futures
- Speaking of threads...
- Identifying individual threads and the current thread
- Thread exhaustion and std::async
- Building your own thread pool
- Improving our thread pool's performance
- Summary
- Allocators
- An allocator is a handle to a memory resource
- Refresher - Interfaces versus concepts
- Defining a heap with memory_resource
- Using the standard memory resources
- Allocating from a pool resource
- The 500 hats of the standard allocator
- Carrying metadata with fancy pointers
- Sticking a container to a single memory resource
- Using the standard allocator types
- Setting the default memory resource
- Making a container allocator-aware
- Propagating downwards with scoped_allocator_adaptor
- Propagating different allocators
- Summary
- Iostreams
- The trouble with I/O in C++
- Buffering versus formatting
- Using the POSIX API
- Using the standard C API
- Buffering in the standard C API
- Formatting with printf and snprintf
- The classical iostreams hierarchy
- Streaming and manipulators
- Streaming and wrappers
- Solving the sticky-manipulator problem
- Formatting with ostringstream
- A note on locales
- Converting numbers to strings
- Converting strings to numbers
- Reading a line or word at a time
- Summary
- Regular Expressions
- What are regular expressions?
- A note on backslash-escaping
- Reifying regular expressions into std::regex objects
- Matching and searching
- Pulling submatches out of a match
- Converting submatches to data values
- Iterating over multiple matches
- Using regular expressions for string replacement
- A primer on the ECMAScript regex grammar
- Non-consuming constructs
- Obscure ECMAScript features and pitfalls
- Summary
- Random Numbers
- Random numbers versus pseudo-random numbers
- The problem with rand()
- Solving problems with <random>
- Dealing with generators
- Truly random bits with std::random_device
- Pseudo-random bits with std::mt19937
- Filtering generator outputs with adaptors
- Dealing with distributions
- Rolling dice with uniform_int_distribution
- Generating populations with normal_distribution
- Making weighted choices with discrete_distribution
- Shuffling cards with std::shuffle
- Summary
- Filesystem
- A note about namespaces
- A very long note on error-reporting
- Using <system_error>
- Error codes and error conditions
- Throwing errors with std::system_error
- Filesystems and paths
- Representing paths in C++
- Operations on paths
- Statting files with directory_entry
- Walking directories with directory_iterator
- Recursive directory walking
- Modifying the filesystem
- Reporting disk usage
- Summary 更新時(shí)間:2021-07-08 10:20:56