Unique Pointers

  • This is a non-member function.
  • There are several versions of this.
  • data = make_unique<int>();
    data1 = make_unique<int>(7);
    data2 = make_unique<int[]>(size);
             
  • They act like pointers or arrays
  • The move function is required to copy one.
  • get gets the underlying pointer.
  • Look at uniqueTest.cpp.
  • An application