Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
a5e264cb
Commit
a5e264cb
authored
Aug 04, 2016
by
Davis King
Browse files
Added check for initializer list support so code compiles in visual studio.
parent
87e04764
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
dlib/assert.h
dlib/assert.h
+8
-0
dlib/matrix/matrix.h
dlib/matrix/matrix.h
+5
-3
No files found.
dlib/assert.h
View file @
a5e264cb
...
...
@@ -31,12 +31,20 @@
# if __has_feature(cxx_rvalue_references)
# define DLIB_HAS_RVALUE_REFERENCES
# 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__)
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_INITIALIZER_LISTS
#elif defined(_MSC_VER) && _MSC_VER >= 1600
# 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)
# define DLIB_HAS_RVALUE_REFERENCES
# define DLIB_HAS_INITIALIZER_LISTS
#endif
...
...
dlib/matrix/matrix.h
View file @
a5e264cb
...
...
@@ -16,7 +16,7 @@
#include "matrix_assign_fwd.h"
#include "matrix_op.h"
#include <utility>
#ifdef DLIB_HAS_
RVALUE_REFERENCE
S
#ifdef DLIB_HAS_
INITIALIZER_LIST
S
#include <initializer_list>
#endif
...
...
@@ -1114,7 +1114,7 @@ namespace dlib
matrix_assign
(
*
this
,
m
);
}
#ifdef DLIB_HAS_
RVALUE_REFERENCE
S
#ifdef DLIB_HAS_
INITIALIZER_LIST
S
matrix
(
const
std
::
initializer_list
<
T
>&
l
)
{
if
(
NR
*
NC
!=
0
)
...
...
@@ -1169,7 +1169,9 @@ namespace dlib
temp
.
swap
(
*
this
);
return
*
this
;
}
#endif // DLIB_HAS_INITIALIZER_LISTS
#ifdef DLIB_HAS_RVALUE_REFERENCES
matrix
(
matrix
&&
item
)
{
#ifdef MATLAB_MEX_FILE
...
...
@@ -1210,7 +1212,7 @@ namespace dlib
#endif
return
*
this
;
}
#endif
#endif
// DLIB_HAS_RVALUE_REFERENCES
template
<
typename
U
,
size_t
len
>
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