▲ 193 ▼ Is my fear of C/++ Justified? (quokk.au) submitted 1 week ago by Solrac to c/programmer_humor@programming.dev 33 comments fedilink hide all child comments
[–] glibg10b@lemmy.zip 9 points 1 week ago (4 children) Even C++11 is pretty old. I would recommend at least C++17 permalink fedilink source parent hideshow 4 child comments replies: [–] boonhet@sopuli.xyz 5 points 1 week ago (3 children) As someone who last touched any C++ books when C++11 was very new and has only written like 20-30 lines of non-tutorial C++ since then, what are some significant changes to the language that I should be aware of if I wanted to give it a try now? permalink fedilink source parent hideshow 3 child comments replies: [–] glibg10b@lemmy.zip 11 points 1 week ago (1 child) A few examples: CTAD: Instead of std::pair<int, int> myPair{ 1, 2 }, you just write std::pair myPair{ 1, 2 } std::optional, std::variant and std::any Guaranteed copy elision in some cases, making it more feasible to apply the rule of 5 everywhere Attributes like [[nodiscard]] (compiler warning if an object or return value is discarded) and [[fallthrough]] (suppress a switch fallthrough warning) Generic lambdas ([](auto it){ /* do something */ }) std::string_view, which is much safer as a function parameter than const char* permalink fedilink source parent hideshow 1 child comment replies: [–] victorz@lemmy.world 6 points 1 week ago Class Template Argument Deduction (CTAD) For anyone wondering, like I did. permalink fedilink source parent [–] steve_lebt_in_overflow@programming.dev 1 point 1 week ago Modules permalink fedilink source parent
[–] boonhet@sopuli.xyz 5 points 1 week ago (3 children) As someone who last touched any C++ books when C++11 was very new and has only written like 20-30 lines of non-tutorial C++ since then, what are some significant changes to the language that I should be aware of if I wanted to give it a try now? permalink fedilink source parent hideshow 3 child comments replies: [–] glibg10b@lemmy.zip 11 points 1 week ago (1 child) A few examples: CTAD: Instead of std::pair<int, int> myPair{ 1, 2 }, you just write std::pair myPair{ 1, 2 } std::optional, std::variant and std::any Guaranteed copy elision in some cases, making it more feasible to apply the rule of 5 everywhere Attributes like [[nodiscard]] (compiler warning if an object or return value is discarded) and [[fallthrough]] (suppress a switch fallthrough warning) Generic lambdas ([](auto it){ /* do something */ }) std::string_view, which is much safer as a function parameter than const char* permalink fedilink source parent hideshow 1 child comment replies: [–] victorz@lemmy.world 6 points 1 week ago Class Template Argument Deduction (CTAD) For anyone wondering, like I did. permalink fedilink source parent [–] steve_lebt_in_overflow@programming.dev 1 point 1 week ago Modules permalink fedilink source parent
[–] glibg10b@lemmy.zip 11 points 1 week ago (1 child) A few examples: CTAD: Instead of std::pair<int, int> myPair{ 1, 2 }, you just write std::pair myPair{ 1, 2 } std::optional, std::variant and std::any Guaranteed copy elision in some cases, making it more feasible to apply the rule of 5 everywhere Attributes like [[nodiscard]] (compiler warning if an object or return value is discarded) and [[fallthrough]] (suppress a switch fallthrough warning) Generic lambdas ([](auto it){ /* do something */ }) std::string_view, which is much safer as a function parameter than const char* permalink fedilink source parent hideshow 1 child comment replies: [–] victorz@lemmy.world 6 points 1 week ago Class Template Argument Deduction (CTAD) For anyone wondering, like I did. permalink fedilink source parent
[–] victorz@lemmy.world 6 points 1 week ago Class Template Argument Deduction (CTAD) For anyone wondering, like I did. permalink fedilink source parent
[–] steve_lebt_in_overflow@programming.dev 1 point 1 week ago Modules permalink fedilink source parent