Home
C++95
Cancel

📚 Book review: "API Design for C++" (2011)

Link to Amazon. The teamlead of a neighboring team recommended me this book. He absolutely loved it 🤩 But I had controversial impressions 🤔 What is an API? The book says: An API is a logical...

A not quite necessary C++23 feature: copying with auto{}

What it takes to copy an object, especially in templated code? Taking into account that declaring the auto variable is always a copy, one can do this: void func(const auto& something) { aut...

How to prepare a programming contest

Probably a lot of coders ever tried to solve tasks from programming contests: in codeforces.com, school olympiads, ACM ICPC, or somewhere else. Most people use C++ to solve tasks. I used to enjo...

📚 Book review: "Advanced C and C++ compiling" (2014)

Link to Amazon. Programming books are often disappointing. They are like a pyramid - the most books are describing trivial things and copy-pasted documentation; books in the middle are more exci...

extern "C" - what does it exactly do?

About 9 years ago I was trying to make games with C++. I used Lua for scripts. It was shipped as a package containing a static library (lua.lib for Windows) and header files. Since Lua is written i...

Fast Pimpl

There is the Pimpl pattern that is used to remove implementation details of a class by placing them in a separate class. Before using the Pimpl, the code may look like this: #include <third_par...

The concept of the static_ptr<T> smart pointer

Original cover image PVS-Studio blog cover image This article was originally published on habr.com, and then translated to English by our fellows at PVS-Studio for their C++ blog. I intive y...

Heterogeneous Lookup

What happens when you try to call .find()/.contains()/etc on an associative container (std::set/std::map/their unordered versions) using a key of a different type? 🤔 std::map&lt;std::string, int&g...

Non-standard C++ containers

PVS-Studio blog cover image This article was originally published on habr.com, and then translated to English by our fellows at PVS-Studio for their C++ blog. I intive you to read the article ...

Reference Lifetime Extension

Today’s Creepy Rule of the Standard: if you’re initializing a const ref (const T&amp;) with a “temporary object” (via rvalue), then the temporary object doesn’t get destroyed immediately, but rathe...