Commit dbbcbc36 authored by Max Kellermann's avatar Max Kellermann

Util/Manual: cast via void* to avoid alignment warnings

parent 18891500
......@@ -95,13 +95,15 @@ public:
T &Get() {
assert(initialized);
return *(T *)data;
void *p = static_cast<void *>(data);
return *static_cast<T *>(p);
}
const T &Get() const {
assert(initialized);
return *(const T *)data;
const void *p = static_cast<const void *>(data);
return *static_cast<const T *>(p);
}
operator T &() {
......
Markdown is supported
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