ObjectFactory example using C++11