Monadic Operations in Modern C++: A Practical Approach
Monadic Operations in Modern C++: A Practical Approach2About me ● Vitaly Fanaskov ● Senior software engineer at reMarkable ● 10+ years of C++ experience ● GIS, VFX, frameworks, and libraries ● Ph (CS) 3Agenda ● Briefly about expected and optional ● Common use cases of expected ● Monadic operations in software development ● Tips and tricks 4In this talk ● Less theory ● C++ only ● Practical a new widget {}: {}.", widgetBox.value(), error); } } 22How do we handle this? 23Monadic operations: and_then if (const auto widgetBox = getNewWidget(); widgetBox.has_value()) { const auto0 码力 | 61 页 | 411.49 KB | 5 月前3Pipeline Architectures in C++: Overloaded Pipe Operator | and Its Monadic Operations
Title: Pipeline architectures in C++: overloaded pipe operator | std::expected and its monadic operations Brief overview: Functional programming in C++ is gaining importance and is attracting programmers operator | will be presented, as well as I’ll explain std::expected and especially its monadic operations that can be tricky in practice. All these together present novel and efficient programming paradigms What's more, std::expected itself allows you to build pipelines – this time using its monadic operations. In this poseter I will explain details how to build your own pipeline architecture in modern0 码力 | 3 页 | 422.24 KB | 5 月前3Back to Basics: The Abstract Machine
machine. The instructions of an abstract machine are tailored to the particular operations required to implement operations of a specific source language or class of languages.” (my emphasis) - Stephan end • There is no room for another language between C++ and the hardware • C++ maps types and operations directly onto hardware • Fundamental C++ types (e.g., char, int, double) map directly into memory directly to hardware addressing capabilities • Modern hardware supports useful arithmetic/logical operations on those entities CppCon 2020 - The Abstract Machine 16Copyright © 2020 Bob Steagall K E W B0 码力 | 91 页 | 538.90 KB | 5 月前3C++23: An Overview of Almost All New and Updated Features
s() Construct string(_view) From nullptr basic_string::resize_and_overwrite() Monadic Operations for std::optional Stacktrace Library Changes to Ranges Library Changes to Views Library s() Construct string(_view) From nullptr basic_string::resize_and_overwrite() Monadic Operations for std::optional Stacktrace Library Changes to Ranges Library Changes to Views Library s() Construct string(_view) From nullptr basic_string::resize_and_overwrite() Monadic Operations for std::optional Stacktrace Library Changes to Ranges Library Changes to Views Library0 码力 | 105 页 | 759.96 KB | 5 月前3Constructing Generic Algorithms
COMPLEXITY GUARANTEES ITERATOR COMPLEXITY GUARANTEES By relaxing the operations, we make our algorithm more useful. By relaxing the operations, we make our algorithm more useful. What was only usable with expensive operations are replaced optimization where expensive operations are replaced with equivalent but less expensive operations." with equivalent but less expensive operations." 40 . 1OPERATIONS TO CONSIDER CONSIDER OPERATIONS TO CONSIDER CAREFULLY CAREFULLY 41 . 1OPERATIONS TO CONSIDER OPERATIONS TO CONSIDER CAREFULLY CAREFULLY decrement 41 . 1OPERATIONS TO CONSIDER OPERATIONS TO CONSIDER CAREFULLY0 码力 | 145 页 | 8.44 MB | 5 月前3Modern C++ Tutorial: C++11/14/17/20 On the Fly
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Basic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Runtime Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 9.2 noexcept and Its Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 9.3 Literal . . . . structure ourselves). But the flaw of std::pair is obvious, only two elements can be saved. Basic Operations There are three core functions for the use of tuples: 1. std::make_tuple: construct tuple 20 码力 | 92 页 | 1.79 MB | 1 年前3A Multithreaded, Transaction-Based Locking Strategy for Containers
might be able to use a readers/writer lock (std::shared_mutex) • What about the case where most operations are writes? • A per-element mutex strategy might work… • ... if a given write operation requires O M P U T I N G Sharing a Container – Avoiding Race Conditions • What about the case where all operations are writes… -- and -- • Each element E to be updated is related to a set RE of other elements O M P U T I N G Sharing a Container – Avoiding Race Conditions • What about the case where all operations are writes… -- and -- • Each element E to be updated is related to a set RE of other elements0 码力 | 142 页 | 474.78 KB | 5 月前3Performance Engineering: Being Friendly to Your Hardware
Decode Queue ROM Cache L1I • Decoded operations may get cached • There is a library of operations for complex instructions and events • Decoded operations may get fusedCode density uint64_t v = instructions as a pattern • And logically combine them • Multiple instructions resulting in fewer operations • ISA restrictions may have impact to performance Imaginary ARM mov r20, 0x123456789abcdef0Register complex • Some operations end here • Can a smart compiler help here? • WLIV historyScheduling 53 Branching Fetch Decode Queue Allocation Scheduling ROM Cache L1I • Not all operations are equal0 码力 | 111 页 | 2.23 MB | 5 月前3Using Modern C++ to Build XOffsetDatastructure
often the top priority. We need every operation to perform well to avoid any bottlenecks. These operations include: • Serialization & deserialization • Read & write • In-place/non-in-place write • The like a road without bottlenecks allows for smooth traffic flow, we need to ensures that all operations run efficiently. Fanchen Su, XOffsetDatastructure, CppCon 2024 13 Read/Write Serialization Deserialization direct reading, writing and transmission. • Moreover, we‘re aiming for high performance across all operations: • serialization, deserialization, reading and writing, both in-place and non-in-place. Fanchen0 码力 | 111 页 | 3.03 MB | 5 月前3Back to Basics: Classic 9STL
Algorithms Strings Ranges Numerics Time Localization Input/Output Regular Expressions Atomic Operations Thread Support The C++20 Standard LibraryCppCon 2021 – Back to Basics: Classic STL Copyright Algorithms Strings Ranges Numerics Time Localization Input/Output Regular Expressions Atomic Operations Thread Support The C++20 Standard Library New General UtilitiesCppCon 2021 – Back to Basics: Bob Steagall Key Principles • Containers store collections of elements • Algorithms perform operations upon collections of elements • Containers and algorithms are entirely independent • Iterators0 码力 | 75 页 | 603.36 KB | 5 月前3
共 207 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
相关搜索词
MonadicOperationsinModernC++PracticalApproachPipelineArchitecturesOverloadedPipeOperatorandItsBacktoBasicsTheAbstractMachine23AnOverviewofAlmostAllNewUpdatedFeaturesConstructingGenericAlgorithmsTutorial11141720OntheFlyMultithreadedTransactionBasedLockingStrategyforContainersPerformanceEngineeringBeingFriendlyYourHardwareUsingBuildXOffsetDatastructureClassic9STL