Calling Functions A Tutorial
Calling Functions A Tutorial Klaus Iglberger, CppCon 2020 klaus.iglberger@gmx.de2 Klaus Iglberger C++ Trainer since 2016 Author of the C++ math library (Co-)Organizer of the Munich Two-Phase Lookup Template Argument Deduction SFINAE Overload Resolution (Viable) Candidate Functions Ranking Ambiguous Function Calls Access Labels Function Template Specializations Virtual Two-Phase Lookup Template Argument Deduction SFINAE Overload Resolution (Viable) Candidate Functions Ranking Ambiguous Function Calls Access Labels Function Template Specializations Virtual0 码力 | 111 页 | 5.11 MB | 5 月前3Back To Basics Functions
for many years -- please provide suggestions, analogies, and other useful ways to think about functions now or in the future!Please do not redistribute slides without prior permission. 4Your Tour Guide for the talk ● Located here: https://github.com/MikeShah/Talks/tree/main/2023/cppcon/functions 6Abstract Functions are one of the first things programmers learn, granting you the ultimate power to 'reuse' overview of functions from the start to the end, on the various powers that are given to us from the ground up. Consider this talk your one stop for learning all of the great things about functions! We'll0 码力 | 123 页 | 7.26 MB | 5 月前3From Functions to Coroutines
From Functions to Coroutines 40 Years Evolution Rainer Grimm Training, Coaching, and Technology Consulting www.ModernesCpp.netEvolution of Callable templateT invoke(Func sequence of functions can be changed ▪ Automatically parallelizable ▪ Results can be cachedPure Functions Working with a pure function is based on discipline Use common functions, meta-functions, constexpr constexpr, or consteval functions ▪ Function int powFunc(int m, int n){ if (n == 0) return 1; return m * powFunc(m, n - 1); } ▪ Meta-Function template struct PowMeta { static int const value 0 码力 | 29 页 | 510.47 KB | 5 月前3Optimizing Away Virtual Functions May Be Pointless
virt_duration = end-start;There are interesting technical details and surprising conclusions that virtual functions can be actually faster. Since CPU architectures are mentioned, I'd expect to see deep assembly eritance-vs-other- ways-performanceDoes it even matter?Conclusions ● The notion that “virtual functions are slower” is flat out wrong. ○ Which is not to say they are faster ○ Some of the suggested0 码力 | 20 页 | 1.19 MB | 5 月前3Combining Co-Routines and Functions into a Job System
Helmut Hlavacs – Combining Co-Routines and Functions into a Job System - CppCon 2021 1 / 39Helmut Hlavacs – Combining Co-Routines and Functions into a Job System - CppCon 2021 2 / 39 About Myself • Professor Processing) Technical Committee 14 Entertainment ComputingHelmut Hlavacs – Combining Co-Routines and Functions into a Job System - CppCon 2021 3 / 39 Creating Game Engines with C++ • Vienna Game Job System Vulkan Game Engine 2.0 https://github.com/hlavacs 20Helmut Hlavacs – Combining Co-Routines and Functions into a Job System - CppCon 2021 4 / 39 The Game Loop auto prev = high_resolution_clock::now();0 码力 | 39 页 | 1.23 MB | 5 月前3Back To Basics: Functional Programming in C++
composing functions. Jonathan Müller — @foonathan Back to Basics: Functional Programming in C++ CppCon 2024-09-19 4Functional Programming Definition Declarative programming by composing functions. fac C++ CppCon 2024-09-19 4Functional Programming Definition Declarative programming by composing functions. fac :: Int -> Int fac 0 = 1 fac n = n * fac (n - 1) sort :: [Int] -> [Int] sort [] = [] sort CppCon 2024-09-19 6Functional programming in C++ Definition Declarative programming by composing functions. Jonathan Müller — @foonathan Back to Basics: Functional Programming in C++ CppCon 2024-09-19 7Functional0 码力 | 178 页 | 918.67 KB | 5 月前3C++ Exceptions for Smaller Firmware
UsageBack to Class! 151617 Consider the output pin Microcontroller18 Consider the output pin Microcontroller pins Microcontroller19 Consider the output pin Microcontroller Pin resistor LOW = ~0V time voltage20 Consider the output pin Microcontroller Pin resistor HIGH = ~3.3V time voltage electrical currentclass output_pin { public: virtual ~output_pin() = default; virtual void void level(bool p_high) = 0; }; 2122 class output_pin { public: virtual ~output_pin() = default; virtual void level(bool p_high) = 0; }; Is returning void okay?I2C Bus Controller SDA SCL I2C0 码力 | 237 页 | 6.74 MB | 5 月前3julia 1.10.10
. . . . . . . . . . . . . . . . . . . . . . . . . 25 5 Mathematical Operations and Elementary Functions 26 5.1 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Raw String Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 8 Functions 67 8.1 Argument Passing Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.4 Operators Are Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 8.5 Operators With Special Names0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.10.9
. . . . . . . . . . . . . . . . . . . . . . . . . 25 5 Mathematical Operations and Elementary Functions 26 5.1 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Raw String Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 8 Functions 67 8.1 Argument Passing Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.4 Operators Are Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 8.5 Operators With Special Names0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.11.4
. . . . . . . . . . . . . . . . . . . . . . . . . 29 6 Mathematical Operations and Elementary Functions 30 6.1 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Annotated Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 9 Functions 72 9.1 Argument Passing Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 9.4 Operators Are Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 9.5 Operators With Special Names0 码力 | 2007 页 | 6.73 MB | 3 月前3
共 278 条
- 1
- 2
- 3
- 4
- 5
- 6
- 28