February 2015

Video Tutorial: Handle-based entity management—Vittorio Romeo

Almost every C++ application and game deals with entity management.

Video Tutorial -- Handle-based entity management

By Vittorio Romeo

From the tutorial:

Entities are usually self-contained objects that...

  • ...store data and/or logic.
  • ...are tied a specific concept (e.g. an UI widget, or a 3D model).
  • ...we need to keep track of.
  • ...can either be alive or dead.
  • ...are extremely often used in groups.

Problem: we need to keep track of specific entity instances, and iterate on every instance. We also need to remove dead entities and add new entities.

Keeping track of specific instances is easily solved with pointers and smart pointers.
Fast-iteration of a group of objects with the same type is achieved with cache-friendly memory locality and no indirection.
Adding and removing entities stored in a cache-friendly manner invalidates existing pointers.

How can we facilitate instance tracking/addition/removal and still allow fast iteration?

In this video, we will create a generic container that stores objects in a cache-friendly way, allows to keep track of specific object instances and also allows addition and removal of entities. 


John Lakos interviews Alexander Stepanov and Daniel Rose on their new Book

Published on InformIT in which John Lakos interviews Alexander Stepanov and Daniel Rose about various aspects of generic programming and modern C++.

From Mathematics to Generic Programming: An Interview with Alexander Stepanov and Daniel RoseFrom Mathematics to Generic Programming


John Lakos interviews Alexander Stepanov and Daniel Rose, authors of From Mathematics to Generic Programming, on their new book, why it applies to everyday programmers, and their positions on some closely related technical issues — including value semantics, concepts, contracts, and polymorphic memory resources — facing the C++ Standards Committee today.

Fighting off memory leaks and errors (C++11)—Kacper KoƂodziej

This article talks about how modern C++ idioms could be used to avoid memory leak and errors.

Fighting off memory leaks and errors (C++11)

by Kacper Kolodziej

From the article:

Modern tools provided with C++11's standard library make fight with memory leaks and errors easier and more effective. Sometimes problems which are seemingly not dangerous might put an end to your application. We are going to learn how to find and avoid them.

Counting bits—Jens Weller

How to generate random bytes and how generic programming allow/support reuse code for different types.

   Counting bits

   by Jens Weller

From the article:

I did a bit of fun coding. I'm currently thinking on how to generate random bytes, for example the 16 random bytes for the initialization vector of AES. The mersenne twister RNG is known to give very good randomness, so it would be a possible an easy source. An std::array<uint32_t,4> would be a good container, filled with generate. But first, I wanted to know, how random is the mersenne twister really? So, when counting the bits in the result of a few thousand calls to a rng, the distribution should be even. So, today I wrote code that counts bits, and tested it on the mersenne twister.


Boost libraries are now supported in biicode

First step to a complete integration of the C++ deps manager biicode with the most popular set of C++ libs: Boost libraries.

Boost libraries are now supported in biicode

by Manu Sánchez

From the news:

At biicode we have been working hard to simplify the process of making Boost available for any C++ programmer with just an include. But this is only the start, the project has been released as open source to allow everyone contribute and help.

CppCon 2014 Make Simple Tasks Simple!—Bjarne Stroustrup

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Elevate Your Code to Modern C++11 with Automated Tooling

by Bjarne Stroustrup

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ faces two challenges: Helping programmers address the most demanding tasks in terms of performance, scale, and dependability. It must also help programmers be productive writing ordinary maintainable code. There is much more "ordinary code" than there is performance-critical code. Thus, C++ must make simple tasks simple while not getting in the way of tuning software for the last byte and last cycle where that's necessary. This talk focuses on what C++11 and C++14 offers to simplify programming: auto, range-for loops, move semantics, futures, concepts, and more. However, the focus is not primarily on language features: the key is programming: how can we write better, more readable, efficient, and more maintainable code? If you think that the essence of C++ is clever pointer manipulation and huge class hierarchies you may be in for a few surprises.

Common Algorithm Patterns—Scott Prager

An interesting article concerning ranges, and how to make the ever useful algorithm header even more effective:

Common algorithm patterns

by Scott Prager

From the article:

Of the STL, <algorithm> may be the most well-used non-container library, but often requires a level of verbosity that requires just as much typing as the hand-written loop, making it not always feel so convenient. It benefits code that uses it with increased clarity and mathematical soundness, so reducing the syntactic overhead should be a goal of those using it. Today I will talk about these problems and demonstrate ways of making it more terse and sound.

C++17 Library Papers for Cologne - Part II

The second and last part in my miniseries about the library papers for next weeks LWG Meeting:

C++17 Library Papers for Cologne - Part II

by Jens WEller

From the article:

This is the second part about the papers for the Library Working Group Meeting in Cologne next week. The last part already covered some interesting papers, and gives an impression on what will be included into the Standard Library for C++17...

cppcast episode 1: Jon Kalb loves the C++ Community

cppcast.PNGThis is the first episode of cppcast, the only podcast by C++ developers for C++ developers. In this first episode host Rob Irving interviews Jon Kalb about the state of the C++ Community.

cppcast episode 1: Jon Kalb loves the C++ Community

by Rob Irving

About the interviewee:

Jon has been writing C++ for two and half decades, does onsite C++ training, and works on the Amazon search engine for A9.com. He chairs the CppCon and C++Now conferences. He also programs the C++ Track for the Silicon Valley Code Camp and serves as chair of the Boost Libraries Steering Committee.