Skip to content
Snippets Groups Projects
Commit b9834880 authored by Vasileios Karakasis's avatar Vasileios Karakasis Committed by Sam Yates
Browse files

Fixes icc compilation of uninitialized (#114)

Fix compilation issue with uninitialized introduced in PR #101.
* Use `const void*` in `static_cast` for `cptr()` member function.
parent 4e229b01
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
*
* The uninitialized<X> structure holds space for an item of
* type X, leaving its construction or destruction to the user.
*
*
* Specialisations for reference types X& and for the void type
* allow for the handling of non-value types in a uniform manner.
*/
......@@ -34,7 +34,7 @@ public:
using const_reference= const X&;
pointer ptr() { return static_cast<X*>(static_cast<void*>(&data)); }
const_pointer cptr() const { return static_cast<const X*>(static_cast<void*>(&data)); }
const_pointer cptr() const { return static_cast<const X*>(static_cast<const void*>(&data)); }
reference ref() { return *ptr(); }
const_reference cref() const { return *cptr(); }
......@@ -106,7 +106,7 @@ public:
};
/* Wrap a void type in an uninitialized template.
*
*
* Allows the use of uninitialized<X> for void X, for generic applications.
*/
template <>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment