Tag Archives: value semantics

Using PODs in C++11

In one of my previous posts I tried to show how Boost’s value_initialized can be used to make the usage of PODs (POD = “Plain Old Data”) in C++03 a bit easier. In C++11 this is not necessary. The new … Continue reading

Posted in programming | Tagged , , | 12 Comments

Value semantics

There is a couple of things that make C++ unique among other contemporary mainstream programming languages. One of these things is value semantics. This feature is easily missed by programmers that come into C++ from heavy-OO world, especially that there … Continue reading

Posted in programming | Tagged , | 19 Comments

Move Constructor — updated

Having read this comment by Howard Hinnant, I realized that I confused the readers a bit. By giving the examples I forgot that copy elision, if affordable, gives better performance optimization than move constructor, and did not say that move … Continue reading

Posted in programming | Tagged , | Leave a comment

Null-state — part II

In the previous post we introduced the concept of a null-state. Now it is time to expand a bit more on the subject. We will see how null-state is even more useful in C++11, whether it is worth using it, … Continue reading

Posted in programming | Tagged , | 1 Comment

Null-state — part I

We are fairly used to macro NULL in C++03 and now we will be getting used to the new keyword nullptr in C++11. The goal of this post is to introduce some philosophy behind using null-pointers, generalize the concept of … Continue reading

Posted in programming | Tagged , | Leave a comment

Value-initialization with Boost

One of the fundamental concepts in STL is RegularType. This is more-less what containers expect of their elements: default construction, destruction, copy-ability (copy constructor and copy assignment), movability (move constructor and move assignment), equality (operator==), ordering (operator<). C++ does a … Continue reading

Posted in programming | Tagged , , | 1 Comment

Move constructor — Q&A

After a brief introduction to Move constructor, it is time to get into some technical details of implementing your own move constructor. In this post I try to answer some questions that I saw on the web and that I … Continue reading

Posted in programming | Tagged , | 5 Comments