diff options
Diffstat (limited to 'cpp/include/Ice/FactoryTableInit.h')
-rw-r--r-- | cpp/include/Ice/FactoryTableInit.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/include/Ice/FactoryTableInit.h b/cpp/include/Ice/FactoryTableInit.h index 5d74985ea85..86287412375 100644 --- a/cpp/include/Ice/FactoryTableInit.h +++ b/cpp/include/Ice/FactoryTableInit.h @@ -69,7 +69,15 @@ public: DefaultObjectFactoryInit(const char* typeId) : _typeId(typeId) { +#ifdef ICE_CPP11_MAPPING + factoryTable->addObjectFactory(_typeId, + [](const std::string&) + { + return ::std::make_shared<O>(); + }); +#else factoryTable->addObjectFactory(_typeId, new DefaultObjectFactory<O>(_typeId)); +#endif } ~DefaultObjectFactoryInit() |