templates

Variadic template make_CString for MFC's CString

  • Posted on: 27 February 2016

For reasons beyond my control, I often work with a codebase that makes use of Microsoft MFC's string class, CString. CString has its detractors and proponents. I don't have a whole lot to add to the debate that hasn't been said already. Instead, I'm going to focus on using C++ variadic templates to get around one of my least favorite CString "anti-idioms". Since I'm not overly familiar with variadic templates, I plan to go over them in slow-mo.

Creating General Algorithm Templates in C++, A Tutorial

  • Posted on: 15 February 2014

Here is a brief, somewhat incomplete, tutorial on how to write some relatively general (read: re-usable) algorithms in C++. The example shown here requires an understanding of both overloading operators, and templates, so if you're a little rusty on those, take a look at these links:

Wikipedia article on template
A very long, but very good tutorial about C++ templates
Wikibook section about operator overloading in C++

Okay, you either skipped those links, or you've come back, with an understanding of templates and overloading operators in-hand.