C++ pointers: why we need them, when we use them, how they differ from accessing to object itself

Even though most programmers understand what is the difference between objects and pointers to them, sometimes it is not entirely clear, which of the ways of accessing the object to choose. We have tried to answer this question below.

Continue reading

The long arrow operator in C++

Sometimes, we need to create wrapper types. For example, types like unique_ptrshared_ptroptional and similar.

Usually, these types have an accessor member function called .get but they also provide the operator-> to support direct access to the contained value similarly to what ordinary pointers do.
unnamed

Continue reading