mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 03:39:55 +00:00
Disallow to call ESMWriter::writeT with pointer type
This will make ESMWriter to use a pointer to this pointer to access the data that is unlikely an intent. For example: 68ef96410cb6731131a82b6b0583ac30e6ffd9fc.
This commit is contained in:
parent
4554a075e7
commit
b17c9a22ff
@ -3,6 +3,7 @@
|
||||
|
||||
#include <iosfwd>
|
||||
#include <list>
|
||||
#include <type_traits>
|
||||
|
||||
#include "components/esm/esmcommon.hpp"
|
||||
#include "loadtes3.hpp"
|
||||
@ -111,6 +112,7 @@ class ESMWriter
|
||||
template<typename T>
|
||||
void writeT(const T& data)
|
||||
{
|
||||
static_assert(!std::is_pointer_v<T>);
|
||||
write((char*)&data, sizeof(T));
|
||||
}
|
||||
|
||||
@ -123,6 +125,7 @@ class ESMWriter
|
||||
template<typename T>
|
||||
void writeT(const T& data, size_t size)
|
||||
{
|
||||
static_assert(!std::is_pointer_v<T>);
|
||||
write((char*)&data, size);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user