Consider the following line of code:
auto source1 = std::unique_ptr<IGpsSource>(new GpsDevice(comPort, baudrate));
auto source2 = std::unique_ptr<IGpsSource>(new GpsLog(filename));
How can that be written using the new std::make_unique
function, supported by VS 2013?
Is it even possible?*
*My problem is that I don't know how to tell std::make_unique
what kind of object to instantiate. Because only the constructor's parameters are passed in there seems to be no control over that.