diff --git a/include/PSX/System/IOPorts/ioport.hpp b/include/PSX/System/IOPorts/ioport.hpp index 1e9a7036..1aae0679 100644 --- a/include/PSX/System/IOPorts/ioport.hpp +++ b/include/PSX/System/IOPorts/ioport.hpp @@ -9,8 +9,9 @@ namespace JabyEngine { T value; public: + // decltype(this) instead of IOPort* lead to wrong runtime behaviour somethow... constexpr T read() const { - return const_cast(this)->value; + return const_cast*>(this)->value; } template @@ -24,7 +25,7 @@ namespace JabyEngine { } constexpr void write(const T& value) { - const_cast(this)->value = value; + const_cast*>(this)->value = value; } // We keep this a POD so we will not add assignment operators anymore