Apologies if this is a duplicate.. Hopefully it is not. I searched through a long list of questions, but they all seemed to not really explain it.
Here goes: In the follwoing
int main(int,char**){
auto a = make_unique<std::string>("Hello World");
// do stuff with either &*a or a.get()
return 0;
}
is there any difference between &*a
and a.get()
? I know they both return the raw pointer value (unless operator&
is overloaded), but are there any runtime advantages to picking one over the other?