r/cpp • • Sep 20 '26

Magic statics vs. std::call_once

https://devblogs.microsoft.com/oldnewthing/20260916-00/?p=112703
73 Upvotes

11 comments sorted by

View all comments

Show parent comment

7

u/usefulcat Sep 20 '26

Probably also results in more total generated code, due to construction of a temporary at every call site.