Every so often, I'll have to switch between languages for the majority of the code I write (whether for work or for play). I find that C++ is one of those languages that requires a lot of mental cache space, so if I take a long break from it, then I forget a lot of the details. Even things like adding items to an STL container or using the static
storage keyword in various contexts get all jumbled up ("is it add
, append
, push
...oh, it's push_back
").
So what essential tidbits do you like to have loaded into your brain when you're writing C++?
Edit: I should say, I'd like to be able to bookmark this page and use it as my cheatsheet :)
Linux. Linux is also written mostly in C, with some parts in assembly. About 97 percent of the world's 500 most powerful supercomputers run the Linux kernel. It is also used in many personal computers.
like the name suggests, a very small compact sheet containing all the formulas, important points, theories to take into exam. idea is to condense as much info as possible in small space. for programming languages its generally a compilation of important syntax, neat tricks, data types, commonly used library functions.
When I switch back from Java to C++, I like to review items from C++ Coding Standards by Herb Sutter and Andrei Alexandrescu.
Scott Meyers' Effective C++ series are great for this too.
Here are quick basic stuffs that work for me:
std::swap()
const *
means constant data, * const
means constant pointer (read the decl. backwards!).*this
Base::operator=(rhs);
in Derived's operator=()
operator=()
operator=()
by calling the copy constructor (Herb Sutter, Write what you Know, and Know what you Write)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With