Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
446bd3c0
Commit
446bd3c0
authored
Sep 24, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gave array2d and matrix move constructors and move assignment operators.
parent
120f2a76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
array2d_kernel.h
dlib/array2d/array2d_kernel.h
+15
-0
array2d_kernel_abstract.h
dlib/array2d/array2d_kernel_abstract.h
+19
-0
matrix.h
dlib/matrix/matrix.h
+16
-0
No files found.
dlib/array2d/array2d_kernel.h
View file @
446bd3c0
...
@@ -160,6 +160,21 @@ namespace dlib
...
@@ -160,6 +160,21 @@ namespace dlib
set_size
(
rows
,
cols
);
set_size
(
rows
,
cols
);
}
}
#ifdef DLIB_HAS_RVALUE_REFERENCES
array2d
(
array2d
&&
item
)
{
swap
(
item
);
}
array2d
&
operator
=
(
array2d
&&
rhs
)
{
swap
(
rhs
);
return
*
this
;
}
#endif
virtual
~
array2d
(
virtual
~
array2d
(
)
{
clear
();
}
)
{
clear
();
}
...
...
dlib/array2d/array2d_kernel_abstract.h
View file @
446bd3c0
...
@@ -122,6 +122,15 @@ namespace dlib
...
@@ -122,6 +122,15 @@ namespace dlib
- std::bad_alloc
- std::bad_alloc
!*/
!*/
array2d
(
array2d
&&
item
);
/*!
ensures
- Moves the state of item into *this.
- #item is in a valid but unspecified state.
!*/
array2d
(
array2d
(
long
rows
,
long
rows
,
long
cols
long
cols
...
@@ -218,6 +227,16 @@ namespace dlib
...
@@ -218,6 +227,16 @@ namespace dlib
- swaps *this and item
- swaps *this and item
!*/
!*/
array2d
&
operator
=
(
array2d
&&
rhs
);
/*!
ensures
- Moves the state of item into *this.
- #item is in a valid but unspecified state.
- returns #*this
!*/
long
width_step
(
long
width_step
(
)
const
;
)
const
;
/*!
/*!
...
...
dlib/matrix/matrix.h
View file @
446bd3c0
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include "matrix_data_layout.h"
#include "matrix_data_layout.h"
#include "matrix_assign_fwd.h"
#include "matrix_assign_fwd.h"
#include "matrix_op.h"
#include "matrix_op.h"
#include <utility>
#ifdef _MSC_VER
#ifdef _MSC_VER
// Disable the following warnings for Visual Studio
// Disable the following warnings for Visual Studio
...
@@ -1106,6 +1107,21 @@ namespace dlib
...
@@ -1106,6 +1107,21 @@ namespace dlib
matrix_assign
(
*
this
,
m
);
matrix_assign
(
*
this
,
m
);
}
}
#ifdef DLIB_HAS_RVALUE_REFERENCES
matrix
(
matrix
&&
item
)
{
swap
(
item
);
}
matrix
&
operator
=
(
matrix
&&
rhs
)
{
swap
(
rhs
);
return
*
this
;
}
#endif
template
<
typename
U
,
size_t
len
>
template
<
typename
U
,
size_t
len
>
explicit
matrix
(
explicit
matrix
(
U
(
&
array
)[
len
]
U
(
&
array
)[
len
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment