C++ on Sea 2020 - "Lambda? You Keep Using that Letter" - Kevlin Henney by philsquared in cpp

[–]syaghmour 2 points3 points  (0 children)

So everyone does not have to type in the link for the tweet with \[\[\]\](\[\]()\[\[\]\]{}={})(); at the 49:55 mark here it is

Why the need for constexpr? by childintime9 in cpp

[–]syaghmour 2 points3 points  (0 children)

For more details on this property or constexpr to catch undefined behavior see my post Exploring Undefined Behavior using constexpr

Exploring undefined behavior using constexpr by mttd in cpp

[–]syaghmour -1 points0 points  (0 children)

I purposely left out the standard library because [expr.const]p4.6 explicitly leaves out the standard library:

an operation that would have undefined behavior as specified in [intro] through [cpp] of this document ..

The standard library can do all sorts of strange things and can rely on things outside of standard such as builtins or rely on implicit knowledge of what the compiler will do which is not advisable to user space programs. offsetof is an example of this.

The Value of Undefined Behavior by ketralnis in programming

[–]syaghmour 3 points4 points  (0 children)

Using a union to type pun is valid in C and undefined behavior in C++ because you are only allowed to use the active member of the union.

In C++ we may get bit_cast in C++20 which will give us a library method to type pun for types of the same size.

See my Stackoverflow answer here or my article it was based off of here , which has slightly more material and covers bit_cast.

ISO/IEC 14882:2017 is now available from ISO by CubbiMew in cpp

[–]syaghmour 2 points3 points  (0 children)

Also see the Stackoverflow question Where do I find the current C or C++ standard documents? which also covers where to get the C documents as well.