Assume I have a class with different constructors:
class A
{
public:
A(char* string)
{
//...
}
A(int value)
{
//..
}
I had the exact same question a while ago and this is what google helped me find:
unique_ptr foo;
if(isTrue())
foo = std::unique_ptr(new A("10"));
else
foo = std::unique_ptr(new A(10));
Its probably too late for the OP but someone else might hopefully find this useful.