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
3d077f09
Commit
3d077f09
authored
Oct 13, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the is_array2d template.
parent
0957c144
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
array2d_kernel_1.h
dlib/array2d/array2d_kernel_1.h
+8
-0
is_kind.h
dlib/is_kind.h
+13
-0
array2d.cpp
dlib/test/array2d.cpp
+4
-0
No files found.
dlib/array2d/array2d_kernel_1.h
View file @
3d077f09
...
@@ -487,6 +487,14 @@ namespace dlib
...
@@ -487,6 +487,14 @@ namespace dlib
}
}
}
}
// ----------------------------------------------------------------------------------------
template
<
typename
T
,
typename
MM
>
struct
is_array2d
<
array2d
<
T
,
MM
>
>
{
const
static
bool
value
=
true
;
};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
dlib/is_kind.h
View file @
3d077f09
...
@@ -59,6 +59,19 @@ namespace dlib
...
@@ -59,6 +59,19 @@ namespace dlib
ASSERT_ARE_SAME_TYPE
(
helper
,
void
);
ASSERT_ARE_SAME_TYPE
(
helper
,
void
);
};
};
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
struct
is_array2d
:
public
default_is_kind_value
{
/*!
- if (T is an implementation of array2d/array2d_kernel_abstract.h) then
- is_array2d<T>::value == true
- else
- is_array2d<T>::value == false
!*/
};
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
template
<
typename
T
>
...
...
dlib/test/array2d.cpp
View file @
3d077f09
...
@@ -548,6 +548,10 @@ namespace
...
@@ -548,6 +548,10 @@ namespace
DLIB_TEST
((
char
*
)
&
img
[
0
][
0
]
+
img
.
width_step
()
==
(
char
*
)
&
img
[
1
][
0
]);
DLIB_TEST
((
char
*
)
&
img
[
0
][
0
]
+
img
.
width_step
()
==
(
char
*
)
&
img
[
1
][
0
]);
}
}
COMPILE_TIME_ASSERT
(
is_array2d
<
array2d
<
unsigned
char
>
>::
value
==
true
);
COMPILE_TIME_ASSERT
(
is_array2d
<
array2d
<
float
>
>::
value
==
true
);
COMPILE_TIME_ASSERT
(
is_array2d
<
float
>::
value
==
false
);
}
}
...
...
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