Made dlib::array movable.

This commit is contained in:
Davis King 2016-12-09 19:51:58 -05:00
parent 44c3a982bf
commit 65914e729f
2 changed files with 34 additions and 0 deletions

View File

@ -90,6 +90,21 @@ namespace dlib
_at_start(true)
{}
array(
array&& item
) : array()
{
swap(item);
}
array& operator=(
array&& item
)
{
swap(item);
return *this;
}
explicit array (
unsigned long new_size
) :

View File

@ -85,6 +85,25 @@ namespace dlib
- all memory associated with *this has been released
!*/
array(
array&& item
);
/*!
ensures
- move constructs *this from item. Therefore, the state of item is
moved into *this and #item has a valid but unspecified state.
!*/
array& operator=(
array&& item
);
/*!
ensures
- move assigns *this from item. Therefore, the state of item is
moved into *this and #item has a valid but unspecified state.
- returns a reference to #*this
!*/
void clear (
);
/*!