I am working lately a lot on dynamic typing and functional programming in C++. I've recently hacked Kevlin Henney's cool boost::any type and introduced a variation, which allows referencing of values of any type without copying.
Recently I went in hacked up the boost::any type by Kevlin Henney for the OOTL. My variant is called ootl::Object but alongside of it is a new partner in crime called ootl::ObjectPtr. What ObjectPtr does is allow you to refer to just about any value-type without the overhead of a new operation.
The ObjectPtr implementation is a little tough to explain, and is based on the structural sub-typing mechanism I designed for my Interfaces proposal last year, and David Abraham's clever implementation which he posted on comp.std.c++. It essentially creates static function tables at compile-time, and stores a pointer to them along side the pointer to the value.
For those interested in the OOTL::ObjectPtr implementation, I recommend taking a look at the BIL Interfaces Library by Jonathan Turkanis. You can use his library to accomplish pretty much the same thing as follows:
Jonathan's library obviously does a heck of a lot more, and explores deeply the possibilities inherent of structural subtyping. The only drawback of Jonathan's library (if you can call it that) is that it requires Boost.
PS. Coming up soon, things you can do with comma operator overloading and dynamic typing in C++, that your parents don't want you to know about.