Type-safe, memory-managed sum-types in C++11