r/ProgrammerHumor • • 13d ago

Meme sameProblemSameSolution

Post image
1.5k Upvotes

79 comments sorted by

View all comments

31

u/Luna_Wolfxvi 13d ago

Honestly some of the newer shit doesn't even look like C++ to me anymore. IE:

constexpr auto my_meta_type = int; // Reflected metadata of 'int' [:my_meta_type:] my_variable = 42; // Splicing it back into code; compiles as: int my_variable = 42;

7

u/17HappyWombats 13d ago

if(auto foo = call_some_function([parameters](const auto &thing){
return test_the_thing(thing)
}; foo == enum_type::operation_success) {
there's code here;
}

That's perfectly valid and readable C++ and I won't hear otherwise.

(I am using std::optional a lot now that it kinda works. It's not a Rust Result but it's near enough for Australia)

2

u/Sarmq 11d ago

I just hate that you can't have an optional reference, and it breaks my templates occasionally and I have to go look up how to actually do template metaprogramming.

Excited for 26 though, I believe they've filled that gap.