Over the past couple weeks, I’ve been working to update Sauce to take advantage of a couple of the features of “modern C++”. While the time investment has been pretty significant, I feel that the new features are substantial improvements.
Scoped Enums
First, I converted all of our enums to be scoped enums (introduced in C++11). This was more time consuming than I had expected, but well worth the effort.
I wrote up a detailed account in a separate post: Scoped Enums.
Replace NULL
with nullptr
Also, I replaced all instances of NULL
with nullptr
(introduced in C++11).
Similar to many other C++ code bases, our forced include file Core.h
defined NULL
to 0. Unfortunately, since this is simply an integer and not an actual null pointer, using NULL
can hide bugs. In fact, during the transition to nullptr
, I found a few silent issues lurking in our code base.
Further discussion can be found in this post: Nullptr.