Nir's blog Fit for computer consumption

Writing Good C++ By Default, in the STL

If you haven’t seen Herb Sutter’s recent talk at CppCon 2015 “Writing Good C++… by Default”, you should. It’s a great talk that largely discusses static analysis and various types of safety. In particular, he discusses lifetime safety: the risk that objects, particularly non-owning views such as references, pointers,... [Read More]

Multiple Arrays, One Allocation, Generically: MultiArray

In last week’s post I discussed how one could simplify the task of allocating memory for several arrays simultaneously; a joint allocation. This function was nice in that it automatically performed a nice amount of pointer arithmetic. What was not so nice was the fact that the result was not... [Read More]

Joint Allocations in C++

This post was inspired by my recent view of this YouTube. The video is by a gentleman by the name of Jon Blow, who’s talking about a new language for game development. I’m not going to talk much about the video except to use some of the goals and code presented as... [Read More]

Object Theft Etiquette in C++: methods with a side of &&

Sometimes in C++, an object has something that we want. We don’t want to be honest citizens and put in the hard work of copying. Instead we want to steal the something away from the object, and let the object deal. The mechanism we use for this is move semantics.... [Read More]

C++'s Rule of Zero

Some of you probably already know about the Rule of Zero. More of you have probably heard of the Rule of 3 (pre C++ 11) or the rule of 5. Let’s start by reviewing what the Rule of Zero is. What is the Rule of Zero? The idea behind... [Read More]