I agree with Daisy on this one
Titus Winters, C++ committee mailing list (and again at lunch on Tuesday)
+1
Bjarne Stroustrup, C++ committee mailing list
I hate this talk.
Bjarne Stroustrup (paraphrased), CppCon 2021 Keynote
This is nuclear weapons.
Titus Winters, about a C++ library design I proposed
int bar = 0;
void foo() {
static bool unused = []{
bar += 1;
return true;
}();
}
foo():
movzx eax, BYTE PTR guard variable for foo()::unused[rip]
test al, al
je .L13
ret
.L13:
sub rsp, 8
mov edi, OFFSET FLAT:guard variable for foo()::unused
call __cxa_guard_acquire
test eax, eax
jne .L14
add rsp, 8
ret
.L14:
add DWORD PTR bar[rip], 1
mov edi, OFFSET FLAT:guard variable for foo()::unused
add rsp, 8
jmp __cxa_guard_release
bar:
.zero 4
std::execute_thrice
?
Parameter packs are the compile-time data structure of choice. As of C++11, C++ has language support for lists of types. We would be foolish to work with anything else.
Eric Niebler, ericniebler.com/2014/11/13/tiny-metaprogramming-library
Note: This topic has been explored in far, far more detail than I have time for here by Louis Dionne: ldionne.com/2015/11/29/efficient-parameter-pack-indexing.I'm going to focus on the cute" ways of doing it.
??!??!?
Everyone on the C++ committee that I've asked about this.
__cpp_deduction_guides >= 201907
__cpp_deduction_guides >= 201907
, so it's okay?)
x_1, ..., x_n
be the elements of the initializer-list or designated-initializer-list of the braced-init-list, or of the expression-list. [...]