Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
aeb2c3b4
Commit
aeb2c3b4
authored
7 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
staticly checks if template parameter is an arithmetic type for
construction or assignation from 'zero'
parent
33035377
No related branches found
No related tags found
2 merge requests
!2
Develop
,
!1
Develop
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
algebra/TinyVector.hpp
+2
-0
2 additions, 0 deletions
algebra/TinyVector.hpp
with
2 additions
and
0 deletions
algebra/TinyVector.hpp
+
2
−
0
View file @
aeb2c3b4
...
...
@@ -112,6 +112,7 @@ public:
KOKKOS_INLINE_FUNCTION
TinyVector
&
operator
=
(
const
ZeroType
&
z
)
{
static_assert
(
std
::
is_arithmetic
<
T
>
(),
"Cannot assign 'zero' value for non-arithmetic types"
);
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
{
m_values
[
i
]
=
0
;
}
...
...
@@ -147,6 +148,7 @@ public:
KOKKOS_INLINE_FUNCTION
TinyVector
(
const
ZeroType
&
z
)
{
static_assert
(
std
::
is_arithmetic
<
T
>
(),
"Cannot construct from 'zero' value for non-arithmetic types"
);
for
(
size_t
i
=
0
;
i
<
N
;
++
i
)
{
m_values
[
i
]
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment