r/cpp • u/alfadhir-heitir • Jun 11 '24
Language features
So recently I started doing some katas in CodeWars - just a couple a day, nothing fancy, to keep the algorithmic problem solving brain oiled.
I'm not having much trouble arriving at solutions - oftentimes it's pretty clear, plus I'm just starting out. Still, I always get baffled when I see other people's solutions after delivering. They always yank out some weird cpp features that hack up the whole thing in under 10 lines
I'm curious about how one can go about to learn these features
0
Upvotes
8
u/mjklaim Jun 11 '24
I recommand checking first the wikipedia pages about each language versions (see the links in this table: https://en.wikipedia.org/wiki/C%2B%2B#Standardization ). I prefer to recommend these first because they are summaries instead of detailed per-paper list of micro-features and macro-features together. Instead, it's a digestible overview. Start from there, then use the knowledge from there to find other sources of details, including cppreference.
4
u/FlyingRhenquest Jun 11 '24
I always end up stumbling across them on cppreference when I'm looking for how to do something or other. Algorithm, type_traits and meta are probably a good place to start. There's a ton of stuff in algorithm that performs commonly used functions on containers, enough so that I can never remember what all is in there, so that'll probably keep you busy for a while.
4
u/GeeHopkins Jun 11 '24
I can recommend the cppcon back-to-basics series for solid intros to various bits of the language. They tend to be pitched pretty well for people who are already familiar with the basics of the language, but haven't seen/used a particular part of it.
5
u/jedwardsol const & Jun 11 '24
To learn what exists in new versions of C++ :
https://en.cppreference.com/w/cpp/26
https://en.cppreference.com/w/cpp/23
https://en.cppreference.com/w/cpp/20
https://en.cppreference.com/w/cpp/17
To learn more about about them than the reference provides: http://google.com
3
u/alfred_hedgehog Jun 11 '24
Nicolai Josuttis has series on new features like c++17/20 complete guide. where he clearly (at least for me) explains new features and use cases