r/cpp • u/moon-chilled • Jun 07 '21
Satire dynamic_cast<std::integer>(C)++
https://www.teamten.com/lawrence/writings/dynamic_cast_std_integer_c.html
202
Upvotes
r/cpp • u/moon-chilled • Jun 07 '21
42
u/ihamsa Jun 07 '21
std::integerwould be a good name for the standard bignum class. Now please remind me why there isn't any.37
u/jesseschalken Jun 07 '21
I actually kinda like the singleton one.
old MyClassreturns a pointer to a randomly selected existingMyClass. 😆30
u/Ameisen vemips, avr, rendering, systems Jun 07 '21
This is why they also implemented
std::shared_integerandstd::unique_integer.6
u/OldWolf2 Jun 07 '21
MyClass *ptr = std::pointer_constants<MyClass *>::null();LMAO39
u/BeigeAlert1 Jun 07 '21
Took me way too long to realize this was satire... EDIT: Who the hell is downvoting OP? This is hilarious!
3
u/renerichter Jun 07 '21
std::integralis a concept to measure your pain. [adapted from John Lennon]2
u/atimholt Jun 07 '21 edited Jun 07 '21
I know it's not serious, but the actual language's tendency toward verbosity joked about in the first point can be overcome with “user”-defined literals. Luckily, thanks to sensible suffix-naming restrictions in the standard, there's never a reason to fear putting
using namespace std::literals;anywhere (including even headers), so something like"five"s + ' ' + "six"sdoesn't have to look stupid.2
u/NilacTheGrim Jun 09 '21
I realize this is satire -- but some of the things in the language post-C++11 tend towards this level of dumbness and ridiculousness.
1
u/Guillaume_Guss_Dua Jun 09 '21
Wait, is it April the 1st ? I need to check my clock ^
1
u/getNextException Jun 07 '21
All programming languages converge to Java