How do I pass the unique_ptr
in the below code? This code does not compile.
int abc(int*& a)
{
return 1;
}
int main()
{
std::cout<<"Hello World";
std::unique_ptr<int> a(new int);
abc(a.get());
return 0;
}
How do I pass the unique_ptr
in the below code? This code does not compile.
int abc(int*& a)
{
return 1;
}
int main()
{
std::cout<<"Hello World";
std::unique_ptr<int> a(new int);
abc(a.get());
return 0;
}
You may pass it by const reference or reference for example:
int abc(const std::unique_ptr<int>& a)