mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12:00
Minor fixup of vm::ptr
const pointers shouldn't disable reading, they should disable writing.
This commit is contained in:
parent
81805945ce
commit
a981c65d2f
1 changed files with 3 additions and 3 deletions
|
@ -204,13 +204,13 @@ namespace vm
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <bool = false> requires (!std::is_void_v<T> && !std::is_const_v<T>)
|
||||
bool try_read(std::conditional_t<std::is_void_v<T>, char, T>& out) const
|
||||
template <bool = false> requires (!std::is_void_v<T>)
|
||||
bool try_read(std::conditional_t<std::is_void_v<T>, char, std::remove_const_t<T>>& out) const
|
||||
{
|
||||
return vm::try_access(vm::cast(m_addr), &out, sizeof(T), false);
|
||||
}
|
||||
|
||||
template <bool = false> requires (!std::is_void_v<T>)
|
||||
template <bool = false> requires (!std::is_void_v<T> && !std::is_const_v<T>)
|
||||
bool try_write(const std::conditional_t<std::is_void_v<T>, char, T>& _in) const
|
||||
{
|
||||
return vm::try_access(vm::cast(m_addr), const_cast<T*>(&_in), sizeof(T), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue