Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
62b57271
Commit
62b57271
authored
Nov 25, 2016
by
Sam Yates
Committed by
Ben Cumming
Nov 25, 2016
Browse files
Options
Downloads
Patches
Plain Diff
Correct pointer casting operations in `uninitialized` (#101)
Correct pointer casting operations in `uninitialized`: issue #100
parent
bc6bb3ba
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/util/uninitialized.hpp
+4
-4
4 additions, 4 deletions
src/util/uninitialized.hpp
with
4 additions
and
4 deletions
src/util/uninitialized.hpp
+
4
−
4
View file @
62b57271
...
@@ -33,11 +33,11 @@ public:
...
@@ -33,11 +33,11 @@ public:
using
reference
=
X
&
;
using
reference
=
X
&
;
using
const_reference
=
const
X
&
;
using
const_reference
=
const
X
&
;
pointer
ptr
()
{
return
reinterpret
_cast
<
X
*>
(
&
data
);
}
pointer
ptr
()
{
return
static_cast
<
X
*>
(
static
_cast
<
void
*>
(
&
data
)
)
;
}
const_pointer
cptr
()
const
{
return
reinterpret
_cast
<
const
X
*>
(
&
data
);
}
const_pointer
cptr
()
const
{
return
static
_cast
<
const
X
*>
(
static_cast
<
void
*>
(
&
data
)
)
;
}
reference
ref
()
{
return
*
reinterpret_cast
<
X
*>
(
&
data
);
}
reference
ref
()
{
return
*
ptr
(
);
}
const_reference
cref
()
const
{
return
*
reinterpret_cast
<
const
X
*>
(
&
data
);
}
const_reference
cref
()
const
{
return
*
cptr
(
);
}
// Copy construct the value.
// Copy construct the value.
template
<
template
<
...
...
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
sign in
to comment