@iximeow @jyn @rain yeah you can write the equivalent of async rust in c++ with no borrow checker. it is so dubious that there's a clang tidy lint just telling you to not capture *anything* in an async lambda *ever* because the *lambda object itself* can and often will vanish before the end of its own execution due to the surrounding function returning.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rcoro-capture
it's simply absurd.
@iximeow @jyn @rain i learned about this excellent footgun that makes async c++ worthy of jokes because of enabling this lint on lix which *does* use async c++ (as a replacement for setcontext based coroutines, which are worse). it did catch a bug.
now if you ever do that you have to tell your fellow maintainers and the linter why it's ok.
temporary objects' lifetimes are such a funny footgun. and by funny i mean a billion dollar mistake.
@iximeow @jyn @rain our linter is shaping up to be extremely mean to you, and we're going to ship a lot of runtime checking in production if it doesn't have perf impact (we shipped checked signed integers already, no impact). there's not very much else that *can* be done tbh, c++ just doesn't have tools to write safe code.
and the bugs I've caught due to asan have been ridiculous shit like "oh a uaf is happening due to string_view from a string that's modified later in the same function". sigh.