News for hackers. Stuff that matters.

martijntje

Re:C++ Exit-Time Destructors on Saturday March 23, 2024 @08:30AM (#39799451)
If I read that paper correctly, that's only valid if the object can be constructed without code being run - i.e. a trivially constructible type.

Since there is no limitation on the no_destroy type, you can create any type with it, including those which have a non-trivial constructor. Of course, you could use a concept to restrain it to only trivially constructible types, or you could omit the launder in an if constexpr branch and still be compliant.

Re:C++ Exit-Time Destructors on Saturday March 23, 2024 @04:35AM (#39798394)
It's interesting to see that the complexity of c++ is so great that even the code in standards proposals contains undefined behaviour. The no_destroy class triggers UB when .get() is called, because it fails to launder the returned pointer. This is required since c++17.
Re:Resolume on Thursday March 14, 2024 @03:59AM (#39701441)
If you don't care about watermarks, you can try out Resolume for free indefinitely.