Util/Manual: cast via void* to avoid alignment warnings
This commit is contained in:
parent
1889150013
commit
dbbcbc3616
|
@ -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 &() {
|
||||
|
|
Loading…
Reference in New Issue