C++
A function call is an lvalue if it returns an lvalue reference meaning the following fucked up and evil code compiles:
int& get_seven() {
int seven = 7;
return seven;
}
int main() {
get_seven() = 8;
}
re: C++
@wallhackio okay but what does that actually do
re: C++
@aescling i'm not completely sure
re: C++
@wallhackio that has to be a memory integrity error
re: C++
@aescling it does run.......
re: C++
@wallhackio try running it under valgrind
re: C++
@aescling I tried getting WSL to work on my machine and after running into a few issues I don't care enough so you'll have to do it
re: C++
@wallhackio smh @ me fur not setting up the glitchcat tilde yet
re: C++
@aescling @wallhackio undefined behavior.
re: C++
@wallhackio @aescling executing without obvious problems is a perfectly acceptable way to handle undefined behavior.
C++
@wallhackio “returning an lvalue reference” and other statements dreamed up by the truly deranged