Fix weird bug in IOPort
This commit is contained in:
parent
dd7c195b1a
commit
749a872bf2
|
@ -9,8 +9,9 @@ namespace JabyEngine {
|
||||||
T value;
|
T value;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// decltype(this) instead of IOPort<T>* lead to wrong runtime behaviour somethow...
|
||||||
constexpr T read() const {
|
constexpr T read() const {
|
||||||
return const_cast<const volatile decltype(this)>(this)->value;
|
return const_cast<const volatile IOPort<T>*>(this)->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename...ARGS>
|
template<typename...ARGS>
|
||||||
|
@ -24,7 +25,7 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void write(const T& value) {
|
constexpr void write(const T& value) {
|
||||||
const_cast<volatile decltype(this)>(this)->value = value;
|
const_cast<volatile IOPort<T>*>(this)->value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We keep this a POD so we will not add assignment operators anymore
|
// We keep this a POD so we will not add assignment operators anymore
|
||||||
|
|
Loading…
Reference in New Issue