mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Made dlib::array movable.
This commit is contained in:
parent
44c3a982bf
commit
65914e729f
@ -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
|
||||
) :
|
||||
|
@ -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 (
|
||||
);
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user