-
Friends and where to find them
Corner cases of friendship connected with name lookup and templates – all explained.
-
Dynamic_cast and typeid as (non) RTTI tools.
You are already very likely to know about the dynamic_cast and typeid tools from the C++ language. Those tools allow you to get some information about the types of objects in the runtime. And yes… runtime. It’s slow, right? So we would rather not use those tools at all. In this article, we will have…
-
Qualification conversion
Let’s consider following piece of code from the C++ standard: Can you see the issue here? theoretically we are assigning the pointer to the pointer to the non const to the pointer to pointer to the const char. On first sight nothing dangerous happens here. After all we are assigning the pointer, through which we…
-
Value categories – [l, gl, x, r, pr]values
So you have heard about lvalues and rvalues for sure, but there actually are also xvalues, prvalues and glvalues. It’s easy to get lost in it, so let’s have a look at what actually are those things. The picture shows the division of the value categories defined in the draft standard. In this particular case,…