I'm guessing here. I bet you want to create an object of one of 3 subclasses of abstract base class ObjectManager based on the ObjectType argument passed to create.
If this is the case, then ObjectFactory::create has to check the type argument and create the correct subclass object. Something along these lines:
1 2 3 4 5 6 7 8 9 10 11 12
std::unique_tr<ObjectManager> retPtr;
switch (type)
{
case type1:
retPtr.reset(new SubClass1(subclass1Arguments));
break;
case type2:
retPtr.reset(new SubClass2(subclass2Arguments));
break;
...
}
When you use make_unique, you get a unique_ptr of the type of the type being created. You need a unique_ptr to the base class of the type being created. I played with this a bit a little while ago, and the above (reset with new) is the best strategy I came up with. Others here may have better strategies that don't involve new.