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
755e378f
Commit
755e378f
authored
May 20, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the is_signed_type and is_unsigned_type templates to work
with floating point types in addition to integer types.
parent
f7d6ab88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
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