Тёмный

C++ Zero Overhead Pass by Value Through Invocable C++ Abstractions - Filipp Gelman - C++Now 2024 

CppNow
Подписаться 32 тыс.
Просмотров 2,4 тыс.
50% 1

www.cppnow.org​
---
C++ Zero Overhead Pass by Value Through Invocable C++ Abstractions - Filipp Gelman - C++Now 2024
---
This presentation focuses on what happens when non-trivial objects are passed to functions by value. Often this necessitates calling the copy or move constructor of the object's type. This call can be elided when the argument is a prvalue, such as when it is the result of another function or a temporary object of the expected type. The constructor can be elided even if the target function happens to be virtual.
But this doesn't work when invoking a std::function, std::move_only_function, std::function_ref, or even std::reference_wrapper. When the target of these abstractions takes objects by value, there will be at least one additional copy/move of the arguments even if they are prvalues.
But what if this were not the case?
This presentation will explain why library-level abstractions incur the overhead of an additional copy/move, and present a technique for avoiding this overhead. The following extreme example proves the point:
function<void(lock_guard by_value)>([](lock_guard by_value){});
---
Slides: github.com/boo...
Sponsored by Undo: Debug your hardest C++ bugs with time travel debugging → Learn more at bit.ly/cppnow24
---
Filipp Gelman
At Bloomberg LP since 2016, Filipp enjoys exploring the obscure, arcane, and esoteric corners of the C++ language. He is known among his coworkers for heavy use of templates, emphasis on compile time computation, and abusing language features for nefarious purposes.
---
C++Now 2025 - 28th April - 2nd May
C++Now is an annual onsite international C++ programming and coding conference held in Aspen, Colarado. For all C++ developers, C++ software engineers and those involved with the C++ language, CppNow provides an indepth and technical content provided by the best and brightest C++ experts of the C++ world.
Annual CppNow Conference - www.cppnow.org
/ cppnow​
/ cppnow
/ cppnow
/ cppnow
mastodon.socia...
Video Sponsors: millennium and think-cell
---
Videos Filmed & Edited By Bash Films: bashfilms.com/
RU-vid Channel Managed & Optimized By Digital Medium Ltd: events.digital...
---
#boost #cpp #cppprogramming #cplusplus #softwaredeveloper

Опубликовано:

 

20 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
C++ Should Be C++ - David Sankel - C++Now 2024
1:28:49
Просмотров 18 тыс.
Avoid These BAD Practices in Python OOP
24:42
Просмотров 50 тыс.
ИСЧЕЗНИ ВОДУ ДО КОНЦА
00:43
Просмотров 239 тыс.
10 Important Python Concepts In 20 Minutes
18:49
Просмотров 116 тыс.
Are You Accidentally Crippling Your EF Core Queries?
17:18
The Ultimate Tier Programming Tier List | Prime Reacts
26:57
Compilers, How They Work, And Writing Them From Scratch
23:53
Replace Is Number Saves 440GB A WEEK
9:54
Просмотров 195 тыс.