Post B4RZwVeKBkjwDsKuOm by Ronflaix@mastodon.gamedev.place
 (DIR) More posts by Ronflaix@mastodon.gamedev.place
 (DIR) Post #B4RZwVeKBkjwDsKuOm by Ronflaix@mastodon.gamedev.place
       1 likes, 0 repeats
       
       The most cursed thing C/C++ I came up by myself is abusing the lifetime of temporary variable to scope an actual expression with the variable's side effects. For stuff like ImGui, having scoped modifiers like those is pretty nifty but hella cursed# include <print>struct Foo{    Foo() { std::println("Foo();"); }    ~Foo() { std::println("~Foo();"); }};void bar(){    std::println("bar();");}int main(){    (Foo{}, bar());    return 0;}// https://godbolt.org/z/vdEoeqerf for reference
       
 (DIR) Post #B4RZwVr5QIwqrSJ6I4 by JoshJers@mastodon.gamedev.place
       1 likes, 0 repeats
       
       @Ronflaix oh wow that is a terrible/amazing use of the comma operator to one-line a thing that would need braces and a temporary name otherwise.
       
 (DIR) Post #B4RZwWRbEY9gghOGCe by Ronflaix@mastodon.gamedev.place
       0 likes, 0 repeats
       
       (I know there is stuff like Duff's device that really feels like gazing at abysses but that little gem is just something that came up by itself, I didn't try hard to cook.)