Working on the next part of the C++ Metadata series, I decided that I didn’t like the way I was handling setters and getters for object properties. I wanted something even faster and with even less overhead while retaining the extreme simplicity of my API. I discovered some tricks (only tested in Visual Studio 2010 [...]
In Part I in the series on C++ Metadata, I explored how to build the basics of a runtime metadata system for C++ types, including custom classes, third-party libraries’ classes, and even C++ primitives. The article detailed building the low-level facilities to have metadata, but did not cover any real-world uses of metadata. Today’s article [...]
Class metadata systems allow C++ applications to have a sizable fraction of the runtime reflection and introspection available in other high level languages, such as C#, Python, or Java. While C++ does not offer any true metadata system itself (excluding the nearly useless typeinfo/RTTI system, which is barely enough to handle dynamic_cast‘s needs), it’s certainly [...]
C++11 has brought us a few significant language and library improvements which can make for greatly increased API ease of use and performance. Several of these features have a huge impact on how we write custom containers. Since I haven’t seen any in-depth articles on this topic, and honestly haven’t seen any truly in-depth articles [...]
The new C++11 standard includes a nice new feature called range-based for. The syntax allows for simple and quick iteration over ranges, such as containers. Usage looks like so: for (int& x : my_container) { do_something_with(i); } Pretty handy. Unfortunately, this new feature is not supported in MSVC 2010. In fact, very few C++11 [...]
String libraries have been a frequent topic of conversation lately. There’s a lot of things wrong with the C++ standard’s implementation, a lot of missing functionality, and a lot of discussion about the best ways to fix it or work around it. I’m going to go over a few suggestions that I and my fellow [...]
I have written a small demo (tested in GCC 4.6) showing how to get compile-time hashing of a string literal in C++0x.