Like many others before me, I've created an experimental object system (source code). Mine is implemented in C++, but tries to make styles of programming possible that C++ normally does not permit.
We try to revive an old idea, C++ smart references, using modern template-based methods. A novel C++ programming technique, the Doubly Curiously Recurring Template Pattern is developed. Boxing of value types within a smart reference framework is explored.
We apply the smart reference implementation techniques to the related problem of integrating smart pointers with inheritance hierarchies. We are less pessimistic about solving this problem than Scott Meyers in his More Effective C++, Item 28.
C++ has weak mechanisms for constraining template parameters. Previous work on template constraints (Bjarne Stroustrup and Jeremy Siek) has focused on generating better error messages when a template is instantiated with inappropriate types. We focus on a different problem — preventing a template from being instantiated at all. This allows function templates to be overloaded.
C++ enums are convenient, but not typesafe. We explore alternatives for implementing typesafe enums in C++. Along the way we discover two novel idioms for programming in C++, the Enum Literal idiom and the Private Inherited Enum idiom.
The Enum Literal idiom developed previously is generalized and more deeply explored, in the context of a numeric class.
Builtin types have literal values, such as the integer 7. We try to create entities with similar properties for ordinary user-defined C++ classes.
We try to implement a boolean class for C++ with the same sensible semantics as the Java boolean type. The implementation is surprisingly difficult, using three distinct advanced template techniques.
In C++ NULL is, exceptionally, even less typesafe than in C. We show how to restore the minimal safety of C.
There is no truly portable way to implement alignof. But in practice we can come up with a very good approximation.