Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm_ptr.h: Improve try_read() #10627

Merged
merged 7 commits into from Jul 29, 2021
Merged

vm_ptr.h: Improve try_read() #10627

merged 7 commits into from Jul 29, 2021

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Jul 29, 2021

  • Allow if T is not a default constructible type, use bit cast to construct it. Fixes reading vm::ptr<vm::ptr<T, const u32>> for example.
  • Simplify usage, no longer needing to manually construct the destination data and thus always spelling its type. (f.e. if (CellSaveDataSetList list{}; setList.try_read(list)) can become if (auto [ok, list] = setList.try_read(); ok)
  • Use std::addressof where needed.

@elad335
Copy link
Contributor Author

elad335 commented Jul 29, 2021

I kept old variant because of types such as atomic_t<> which are not copy constructible.

@kd-11 kd-11 merged commit d85bb3f into RPCS3:master Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants