Earlier quoted context omitted.
Narrator: They weren’t actually free.
Let's make sure, I'll make a callok?
Retiring a favourite C++ joke
31–40 of 151 posts
Re: Retiring a favourite C++ joke
#32Re: Retiring a favourite C++ joke
#33Do modern cars even allow you to step on the accelerator and the brake at the same time?
I guess you technically can’t in an EV with regenerative braking. (But maybe they do have an actual brake pedal?)
Re: Retiring a favourite C++ joke
#34 int main() {
int tobias[24] = {0,0,33};
delete(tobias+4);
}
Compile and run on Ubuntu 20.04 (may work on other Linuxes), no errors, no warnings, runs perfectly fine.Bonus fun: try printing out the address of `tobias` and `new int[6]` afterwards :)
Re: Retiring a favourite C++ joke
#35Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC
https://www.cs.cmu.edu/~jasonh/personal/humor/compile.html
> This label is the target of a goto from outside of the block containing this label AND this block has an automatic variable with an initializer AND your window wasn't wide enough to read this whole error message
Re: Retiring a favourite C++ joke
#36Do modern cars even allow you to step on the accelerator and the brake at the same time?
I guess you technically can’t in an EV with regenerative braking. (But maybe they do have an actual brake pedal?)
Re: Retiring a favourite C++ joke
#37Earlier quoted context omitted.
According to the TIOBE index, C++ is the fourth most popular programming language, and has been around for over 35 years, so easily a couple thousand people. The question is how many of them are on HN (probably dozens).
Either you did not get the joke, or I did not get your joke.
Re: Retiring a favourite C++ joke
#38Re: Retiring a favourite C++ joke
#39It's an OK C++ joke, but not great. I could certainly give the author a few pointers...
Re: Retiring a favourite C++ joke
#40#include using namespace std; class BadProgrammer { public: void yep() { delete this; } }; int main() { auto x = BadProgrammer{}; x.yep(); cout g++ -Wall -Wextra -Wpedantic main.cc # compiles just fine clang++ -Wall -Wextra -Wpedantic main.cc # also compiles just fine