Building your own ORM... and other Bad Ideas

A project I worked on needed to implement persistent storage to meet a requirement. I volunteered to write it from scratch. Just map objects in memory to your SQL database back end. How hard can it be, right? Oh, and let's do it in C++ for even more fun times.