News for hackers. Stuff that matters.
Re:Parsing Protobuf at 2+GB/S: How I Learned to Love Tail Ca... by ufo on Sunday April 25, 2021 @01:38PM (#26934645)
You can still use this trick in C++ if you ensure that the return statements are outside the scopes that have the RAII objects. It's awkward but it's better than nothing. https://godbolt.org/z/cnbjaK85T

    void foo(int x) {
      {
        MyObj obj; 
        // ...
      }
      return bar(x); // tail call
    }

There are no comments on this comment yet.