Fix weird bug in IOPort
This commit is contained in:
parent
2d174dc79a
commit
d403aedf16
|
@ -9,8 +9,9 @@ namespace JabyEngine {
|
|||
T value;
|
||||
|
||||
public:
|
||||
// decltype(this) instead of IOPort<T>* lead to wrong runtime behaviour somethow...
|
||||
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>
|
||||
|
@ -24,7 +25,7 @@ namespace JabyEngine {
|
|||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue