Back to Basics - Function Call Resolutionfeatures is probably the “std::swapTwo-Step” [Niebler 2014]. The “Two-Step” is a programming technique that allows for a customization point. It’s especially valuable for library authors writing Fortunately, because of how Saks::string provides its custom swapfunction, there’s a simple technique that you can use to avoid this mistake… 77 The std::swap Two-Step If you instead write Person::swaplike the compiler will automatically fall back to using std::swap. Although you can apply this technique easily, the effect is fairly complex… 78Back to Basics - Function Call Resolution Copyright ©0 码力 | 44 页 | 1.30 MB | 6 月前3
Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Codefunctional programming technique for dealing with errors in a clean, compositional, and type-safe wayMonadic Error Handling ● Monadic error handling is a functional programming technique for dealing with errors operations on these typesMonadic Error Handling ● Monadic error handling is a functional programming technique for dealing with errors in a clean, compositional, and type-safe way ● This approach encapsulates is this desirable?Monadic Error Handling ● Monadic error handling is a functional programming technique for dealing with errors in a clean, compositional, and type-safe way ● This approach encapsulates0 码力 | 200 页 | 1.77 MB | 6 月前3
Just-in-Time Compilation - J F Bastien - CppCon 2020values—a powerful but previously little-studied and difficult-to-implement dynamic binary analysis technique, which requires a tool to shadow every register and memory value with another value that describes each path through the loop. We have implemented a dynamic compiler for JavaScript based on our technique and we have measured speedups of 10× and more for certain benchmark programs. Trace-based Just-in-Time each path through the loop. We have implemented a dynamic compiler for JavaScript based on our technique and we have measured speedups of 10× and more for certain benchmark programs. Trace-based Just-in-Time0 码力 | 111 页 | 3.98 MB | 6 月前3
Composing Ancient Mathematical Knowledge Into Powerful Bit-fiddlingChapter 1 of “From Mathematics to Generic Programming” talks about “Egyptian Multiplication”. - A technique used by Ancient Egyptians to multiply by leveraging the power of associativity.Associativity is just integer multiplication? Yup! So, let’s use a different monoid to prove the point that this technique is generalizable.SWAR BriefingWhat is SIMD? Scalar instructions execute against a single set of primitives that are not present in your hardware (e.g. for SWAR or CUDA). - You can use this technique for anything that forms a monoid! You can do soooo muuuuchhhhhhhh with associative iteration!0 码力 | 73 页 | 947.99 KB | 6 月前3
Design and Implementation of Highly Scalable Quantifiable Data Structures in C++Performance ▶ Previous works focus on relaxed correctness conditions ▶ Relaxed semantics is a technique, not a measurement ▶ Need to measure what relaxed semantics and other techniques do ▶ How correct Quantifiable Stack/Queue Live Demonstration Quantifiable Queue ▶ The aforementioned branching technique is not very useful in a queue ▶ Instead, we implement a multi-queue to minimize contention between by permitting relaxed semantics ▶ The vector space model facilitates an efficient verification technique for checking the correctness of a concurrent history ▶ The entropy metric provides designers with0 码力 | 51 页 | 4.08 MB | 6 月前3
Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!concurrency patterns • How existing atomicare implemented (the split reference count technique) • Deferred reclamation, i.e., garbage collection in C++ Some assumed knowledge • You’ve heard concurrency patterns • How existing atomic are implemented (the split reference count technique) • Deferred reclamation, i.e., garbage collection in C++ Some assumed knowledge • You’ve heard 0 码力 | 45 页 | 5.12 MB | 6 月前3
Back to Basics: C++ Templates - Part 2is_pointer_v); Andreas Fertig v1.0 B2B: C++ Templates 11 SFINAE ■ With templates, we have a technique called substitu tion failure is not an error (SFINAE). ■ When the compiler looks into an instantiation Fertig https://AndreasFertig.Info post@AndreasFertig.Info 6SFINAE ■ With templates, we have a technique called SFINAE. ■ When the compiler looks into an instantiation of a template, and it turns out 0 码力 | 12 页 | 787.22 KB | 6 月前3
What Volatile Means (and Doesn't Mean)Miscompiled volatiles Here’s a version that reads the int using a C++ version of their workaround technique: int vol_read_int(int volatile &vp) { return vp; } int volatile v_int; ~~~ int value = vol_read_int(v_int); volatiles Here’s a version that writes to the int using a C++ version of their workaround technique: int volatile &vol_id_int(int volatile &v) { return v; } int volatile v_int; ~~~ vol_id_int(v_int)0 码力 | 32 页 | 901.80 KB | 6 月前3
The Most Important Design Guideline is Testabilitystatic members, which are given * the pointer-to-member values in the specialization. * * This technique has been around in many forms since the original * C++ standard in 1998, but is personally attributed static members, which are given * the pointer-to-member values in the specialization. * * This technique has been around in many forms since the original * C++ standard in 1998, but is personally attributed0 码力 | 126 页 | 9.11 MB | 6 月前3
So You Think You Can HashWrite overloads for primitive/std types (append to the hash) 3. Finalize function -> size_t This technique ensures that: we no longer need to have a combine step we’re using the same hash algorithm and how each field recursively contributes to the overall digest (append/write). 🔶 The same technique can be used with almost every existing hashing algorithm, eg. FNV1a, SipHash, Spooky, Murmur0 码力 | 119 页 | 6.54 MB | 6 月前3
共 58 条
- 1
- 2
- 3
- 4
- 5
- 6
相关搜索词
BacktoBasicsFunctionCallResolutionLeveragingFunctionalApproachforMoreTestableandMaintainableROSCodeJustinTimeCompilationBastienCppCon2020ComposingAncientMathematicalKnowledgeIntoPowerfulBitfiddlingDesignImplementationofHighlyScalableQuantifiableDataStructuresC++LockFreeAtomicSharedPointersWithoutSplitReferenceCountItCanBeDoneTemplatesPartWhatVolatileMeansDoesnMeanTheMostImportantGuidelineisTestabilitySoYouThinkHash













