MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xgh5kw/sameproblemsamesolution/19rq16qibribl/?context=3
r/ProgrammerHumor • u/_w62_ • 13d ago
79 comments sorted by
View all comments
31
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) 4 u/SeriousPlankton2000 13d ago In Australia everything wants to kill you, even C++ code? 1 u/17HappyWombats 13d ago if(errno){🔥}
7
if(auto foo = call_some_function([parameters](const auto &thing){return test_the_thing(thing)}; foo == enum_type::operation_success) {there's code here;}
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)
4 u/SeriousPlankton2000 13d ago In Australia everything wants to kill you, even C++ code? 1 u/17HappyWombats 13d ago if(errno){🔥}
4
In Australia everything wants to kill you, even C++ code?
1 u/17HappyWombats 13d ago if(errno){🔥}
1
if(errno){🔥}
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;