4 ms·
The post seems like it is focused on some ancient version of C++, multiple of these papercuts aren't even valid today. * You can just write = default for those
by TinkersW 3y ago
The post seems like it is focused on some ancient version of C++, multiple of these papercuts aren't even valid today.
* You can just write = default for those methods often enough, and having to implement these is extremely rare
* use [[nodiscard]] for your silly bool get_message return
* C++ does in fact support multiple return types via structured bindings, or just use a struct
None of this is really what is wrong with C++, the real issues are that everyone uses a different build system and a different way of sharing code.
- thecodedmessage 3y agoNo, you cannot use '= default' for the assignment operators if you have custom copy/move constructors. I thought this was clear that this was my complaint in the post. I will make it clearer in the post. IF you customize the constructors, THEN =default will break your code, even though the correct implementation is entirely boilerplate. And for tuples, you still need to use std::tie or std::make_tuple on the other end.