Calling Functions A TutorialCalling 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 Argument Deduction SFINAE Overload Resolution (Viable) Candidate Functions Ranking Ambiguous Function Calls Access Labels Function Template Specializations Virtual Dispatch Deleting FunctionsContent Argument Deduction SFINAE Overload Resolution (Viable) Candidate Functions Ranking Ambiguous Function Calls Access Labels Function Template Specializations Virtual Dispatch Deleting FunctionsDisclaimer0 码力 | 111 页 | 5.11 MB | 6 月前3
Back To Basics Functionsfor 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 | 6 月前3
From Functions to CoroutinesFrom Functions to Coroutines 40 Years Evolution Rainer Grimm Training, Coaching, and Technology Consulting www.ModernesCpp.netEvolution of Callable templateT invoke(Func 20);Callable Function Function Overloading Function Object Lambda Expression CoroutineCallable Function Function Overloading Function Object Lambda Expression CoroutineFunction A function is a sequence packaged as a unit. ▪ Implementation ▪ Each function call creates a stack frame on a stack data structure ▪ The stack frame contains the private data of the function call (parameters, locals and the return 0 码力 | 29 页 | 510.47 KB | 6 月前3
Hidden Overhead of a Function APIenough functions” 5Tony Van Eerd: “people are not writing enough functions” 6Tony Van Eerd: “people are not writing enough functions” 7Tony Van Eerd: “people are not writing enough functions” 8When writing more functions, we’d prefer to get only the well designed ones!When talking about performance, we typically think about the function logic. We’ll see that a well designed function API can have for non-inlined functionsISO C++ wiki: Do inline functions improve performance? Yes and no. Sometimes. Maybe. There are no simple answers. inline functions might make the code faster, they might make it0 码力 | 158 页 | 2.46 MB | 6 月前3
Back to Basics - Function Call ResolutionBack to Basics - Function Call Resolution Copyright © 2024 by Ben Saks and Dan Saks Back to Basics: Function Call Resolution by Ben Saks and Dan Saks September, 2024 1 Saks & Associates These notes +1-412-521-4117 (voice) service@saksandassociates.com saksandassociates.com 2Back to Basics - Function Call Resolution Copyright © 2024 by Ben Saks and Dan Saks About Ben Saks Ben Saks is the chief Ben earned a B.A. with Distinction in Computer Science from Carleton College. 4Back to Basics - Function Call Resolution Copyright © 2024 by Ben Saks and Dan Saks About Dan Saks Dan Saks is the president0 码力 | 44 页 | 1.30 MB | 6 月前3
Limitations and Problems in std::function and SimilarLimitations and Problems in std::function and similar constructs Amandeep Chawla | Sr. Computer Scientist II amandeep@adobe.com | adchawla@gmail.com Image by Bruno Tornielli© 2024 Adobe. All Rights Value)© 2024 Adobe. All Rights Reserved. Adobe Confidential. "Lambda expressions are anonymous functions that can be defined at the point where they are used. They make your code more concise and readable we can control. ▪ std::function© 2024 Adobe. All Rights Reserved. Adobe Confidential. Task Based Mechanism© 2024 Adobe. All Rights Reserved. Adobe Confidential. std::function ▪ Is a class template0 码力 | 62 页 | 3.57 MB | 6 月前3
Optimizing Away Virtual Functions May Be Pointlessvirt_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 | 6 月前3
Combining Co-Routines and Functions into a Job SystemHelmut 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 | 6 月前3
Google C++ Style GuideThere are some com- mon exceptions, such as unittests and small .cc files containing just a main() function. Correct use of header files can make a huge difference to the readability, size and performance header should have header guards and include all other headers it needs. If a template or inline function is declared in a .h file, that same header should provide its definition. The definitions of these possible. Just #include the headers you need. A “forward declaration” is a declaration of a class, function, or template without an associated definition. • Forward declarations can save compile time, as0 码力 | 83 页 | 238.71 KB | 1 年前3
Mypy 1.8.0 Documentationis a static type checker for Python. Type checkers help ensure that you’re using variables and functions in your code correctly. With mypy, add type hints (PEP 484 [https://peps.python.org/pep-0484/]) inference Types from libraries Next steps Type hints cheat sheet Variables Useful built-in types Functions Classes When you’re puzzled or when things are complicated Standard “duck types” Forward references (and lambdas) Union types Optional types and the None type Disabling strict optional checking Type aliases Named tuples The type of class objects Generators Class basics Instance and class attributes Annotating0 码力 | 318 页 | 271.55 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













