Skip to content

Commit

Permalink
add constructors to the listing of unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin committed Jan 3, 2018
1 parent 30cd0d2 commit e2acef8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions smart-pointers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ \subsection{unique\_ptr}
private:
T* ptr;
public:
unique_ptr()
: ptr(nullptr)
{}

unique_ptr(T* ptr)
: ptr(ptr)
{}

~unique_ptr()
{
delete ptr;
Expand Down

0 comments on commit e2acef8

Please sign in to comment.