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
755e378f
Commit
755e378f
authored
May 19, 2012
by
Davis King
Browse files
Changed the is_signed_type and is_unsigned_type templates to work
with floating point types in addition to integer types.
parent
f7d6ab88
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
dlib/algs.h
dlib/algs.h
+5
-2
No files found.
dlib/algs.h
View file @
755e378f
...
...
@@ -512,7 +512,7 @@ namespace dlib
/*!A is_unsigned_type
This is a template where is_unsigned_type<T>::value == true when T is an unsigned
integral
type and false when T is a signed
integral
type.
scalar
type and false when T is a signed
scalar
type.
!*/
template
<
typename
T
...
...
@@ -521,13 +521,16 @@ namespace dlib
{
static
const
bool
value
=
static_cast
<
T
>
((
static_cast
<
T
>
(
0
)
-
static_cast
<
T
>
(
1
)))
>
0
;
};
template
<
>
struct
is_unsigned_type
<
long
double
>
{
static
const
bool
value
=
false
;
};
template
<
>
struct
is_unsigned_type
<
double
>
{
static
const
bool
value
=
false
;
};
template
<
>
struct
is_unsigned_type
<
float
>
{
static
const
bool
value
=
false
;
};
// ----------------------------------------------------------------------------------------
/*!A is_signed_type
This is a template where is_signed_type<T>::value == true when T is a signed
integral
type and false when T is an unsigned
integral
type.
scalar
type and false when T is an unsigned
scalar
type.
!*/
template
<
typename
T
...
...
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