C++11

C++11 is the version of C++ standardized in 2011 – the first update to the C++ language since its original standardization back in 1998.

A while ago a guy I know was working on a program that involved a large number of “jobs” read from a file/database. The issue he had was that he wanted different “views” of those jobs – for example, he wanted a view of the jobs sorted by job ID, another of the jobs sorted by start/end time, another sorted by priority, and so on. Continue Reading

When move semantics were introduced in C++11, it sparked a lot of discussion about how to pass arguments to functions that will take a copy of the argument value (for example, the “set” half of get/set functions). That confusion seemed to subside when the “by value by default” suggestion started to make the rounds, but in his CppCon2014 talk, Herb Sutter set off a whole new round of debate. Sutter makes two arguments for why “by const-ref by default” is the best rule. I don’t buy them. Continue Reading

A problem I come across rather frequently has to do with the fact that input in C++ requires a pre-existing variable of the correct type, which either has to be uninitialized or initialized to some “safe” value. There’s a third option, though, and it’s the topic of my first Tippet. Continue Reading

I should probably qualify my bluster about all the code on this blog being C++14. While it is true that all of the code on this blog, unless otherwise specified, will be C++14, it is not likely that it will be properly displayed that way. I haven’t dug too deeply into it yet, but I don’t think the syntax-highlighting plugin I’m using supports C++14. In fact, I don’t think it even supports C++11. Continue Reading