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
a5e264cb
Commit
a5e264cb
authored
Aug 05, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check for initializer list support so code compiles in visual studio.
parent
87e04764
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
assert.h
dlib/assert.h
+8
-0
matrix.h
dlib/matrix/matrix.h
+5
-3
No files found.
dlib/assert.h
View file @
a5e264cb
...
@@ -31,12 +31,20 @@
...
@@ -31,12 +31,20 @@
# if __has_feature(cxx_rvalue_references)
# if __has_feature(cxx_rvalue_references)
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_RVALUE_REFERENCES
# endif
# endif
# if __has_feature(cxx_generalized_initializers)
# define DLIB_HAS_INITIALIZER_LISTS
# endif
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_INITIALIZER_LISTS
#elif defined(_MSC_VER) && _MSC_VER >= 1600
#elif defined(_MSC_VER) && _MSC_VER >= 1600
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_RVALUE_REFERENCES
#elif defined(_MSC_VER) && _MSC_VER >= 1800
# define DLIB_HAS_INITIALIZER_LISTS
# define DLIB_HAS_RVALUE_REFERENCES
#elif defined(__INTEL_COMPILER) && defined(BOOST_INTEL_STDCXX0X)
#elif defined(__INTEL_COMPILER) && defined(BOOST_INTEL_STDCXX0X)
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_INITIALIZER_LISTS
#endif
#endif
...
...
dlib/matrix/matrix.h
View file @
a5e264cb
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include "matrix_assign_fwd.h"
#include "matrix_assign_fwd.h"
#include "matrix_op.h"
#include "matrix_op.h"
#include <utility>
#include <utility>
#ifdef DLIB_HAS_
RVALUE_REFERENCE
S
#ifdef DLIB_HAS_
INITIALIZER_LIST
S
#include <initializer_list>
#include <initializer_list>
#endif
#endif
...
@@ -1114,7 +1114,7 @@ namespace dlib
...
@@ -1114,7 +1114,7 @@ namespace dlib
matrix_assign
(
*
this
,
m
);
matrix_assign
(
*
this
,
m
);
}
}
#ifdef DLIB_HAS_
RVALUE_REFERENCE
S
#ifdef DLIB_HAS_
INITIALIZER_LIST
S
matrix
(
const
std
::
initializer_list
<
T
>&
l
)
matrix
(
const
std
::
initializer_list
<
T
>&
l
)
{
{
if
(
NR
*
NC
!=
0
)
if
(
NR
*
NC
!=
0
)
...
@@ -1169,7 +1169,9 @@ namespace dlib
...
@@ -1169,7 +1169,9 @@ namespace dlib
temp
.
swap
(
*
this
);
temp
.
swap
(
*
this
);
return
*
this
;
return
*
this
;
}
}
#endif // DLIB_HAS_INITIALIZER_LISTS
#ifdef DLIB_HAS_RVALUE_REFERENCES
matrix
(
matrix
&&
item
)
matrix
(
matrix
&&
item
)
{
{
#ifdef MATLAB_MEX_FILE
#ifdef MATLAB_MEX_FILE
...
@@ -1210,7 +1212,7 @@ namespace dlib
...
@@ -1210,7 +1212,7 @@ namespace dlib
#endif
#endif
return
*
this
;
return
*
this
;
}
}
#endif
#endif
// DLIB_HAS_RVALUE_REFERENCES
template
<
typename
U
,
size_t
len
>
template
<
typename
U
,
size_t
len
>
explicit
matrix
(
explicit
matrix
(
...
...
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