Enabling C++11 And Later In CMake
Updated June 2020 With the constant evolution of C++, build systems have had to deal with the complication of selecting the relevant compiler and linker flags. If your project targets multiple...
View ArticleLet your compiler do your housekeeping
A common sequence of steps we mortal software developers frequently find ourselves implementing goes something like this: Perform some sort of setup or acquire some sort of resource. Carry out some...
View ArticleOnLeavingScope: The sequel
In a previous article, the OnLeavingScope class was presented as a technique for robustly and concisely handling scenarios involving multi-step setup, run and cleanup stages. It focused on ease of...
View ArticleMove constructors can copy and std::move doesn’t move anything
I recently came across an interesting use of std::move which looked something like the following: void MyObject::processItems() { std::vector<int> items(std::move(m_items)); for (auto item :...
View ArticleMember Function Overloading: Choices You Didn’t Know You Had
Let’s explore your understanding of member function overloading. For a given class, how many different non-template overloads can you define for a given function where the function takes no arguments?...
View ArticleUsing ccache with CMake
Updated 1st February 2017 Working with very large C/C++ code bases will sometimes test your patience. Build times in particular can be a sore point, especially if the development team do not have a...
View ArticleAvoiding Copies And Moves With auto
When C++11 introduced auto, it opened up a whole range of useful techniques and improved the life of C++ developers in a variety of ways. There’s no shortage of simple examples and tutorials teaching...
View ArticleCMake And C++ Consulting Services Now Available
Following the successful launch of my book Professional CMake: A Practical Guide last year and receiving positive feedback from readers, I’m pleased to announce that I’ve formed my own consulting...
View ArticleCppCon 2019: Deep CMake For Library Authors
This talk presents a road map for C++ library authors grappling with cross-platform aspects of library development and deployment. It highlights key CMake features that every cross-platform library...
View ArticleC++20 Modules, CMake, And Shared Libraries
CMake 3.28 was the first version to officially support C++20 modules. Tutorials and examples understandably tend to focus on the fairly simple scenario of building a basic executable, perhaps also...
View Article