I've been trying out the "new" (new to me, even though it's now 4 years old) C++11 stuff, specifically the unique_ptr, and was wondering: how do you return, by value, an object containing a unique_ptr data member?
I use it in void by using reference the & which you would include with the pointer. Something like this.
1 2 3 4 5 6 7 8 9 10 11 12
void insertFirst(nodeType *& head, string item)
{
// step 1. Make the "New node"
nodeType *newNode = new nodeType;
newNode->info = item; // set the "info" on the newNode to the "item" received via function paramter
// step 2. Set the "Link" of "new node" to the current "head"
newNode->link = head;
// step 3. Update "head" to now point to this "new node"
head = newNode;
}