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
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
62b57271
Commit
62b57271
authored
8 years ago
by
Sam Yates
Committed by
Ben Cumming
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Correct pointer casting operations in `uninitialized` (#101)
Correct pointer casting operations in `uninitialized`: issue #100
parent
bc6bb3ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide 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:
using
reference
=
X
&
;
using
const_reference
=
const
X
&
;
pointer
ptr
()
{
return
reinterpret
_cast
<
X
*>
(
&
data
);
}
const_pointer
cptr
()
const
{
return
reinterpret
_cast
<
const
X
*>
(
&
data
);
}
pointer
ptr
()
{
return
static_cast
<
X
*>
(
static
_cast
<
void
*>
(
&
data
)
)
;
}
const_pointer
cptr
()
const
{
return
static
_cast
<
const
X
*>
(
static_cast
<
void
*>
(
&
data
)
)
;
}
reference
ref
()
{
return
*
reinterpret_cast
<
X
*>
(
&
data
);
}
const_reference
cref
()
const
{
return
*
reinterpret_cast
<
const
X
*>
(
&
data
);
}
reference
ref
()
{
return
*
ptr
(
);
}
const_reference
cref
()
const
{
return
*
cptr
(
);
}
// Copy construct the value.
template
<
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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