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

Replace simple_type with std::common_type #10121

Merged
merged 1 commit into from Apr 17, 2021
Merged

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Apr 16, 2021

No description provided.

@@ -1710,6 +1705,9 @@ class atomic_t<bool, Align> : private atomic_t<uchar, Align>
}
};

template <typename T1, usz Align, typename T2, usz Align2>
struct std::common_type<atomic_t<T1, Align>, atomic_t<T2, Align2>> : std::common_type<T1, T2> {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's missing asymmetric specializations, where only left or right part is atomic_t, for example.

Suggested change
struct std::common_type<atomic_t<T1, Align>, atomic_t<T2, Align2>> : std::common_type<T1, T2> {};
struct std::common_type<atomic_t<T1, Align>, atomic_t<T2, Align2>> : std::common_type<T1, T2> {};
template <typename T1, usz Align, typename T2>
struct std::common_type<atomic_t<T1, Align>, T2> : std::common_type<T1, std::common_type_t<T2>> {};
template <typename T1, typename T2, usz Align2>
struct std::common_type<T1, atomic_t<T2, Align2>> : std::common_type<std::common_type_t<T1>, T2> {};

@Nekotekina
Copy link
Member

Nekotekina commented Apr 16, 2021

During some experiments I found out that atomic_t<bool> needs

explicit operator uchar() const = delete;

@Nekotekina Nekotekina merged commit 67e2e15 into RPCS3:master Apr 17, 2021
@elad335 elad335 deleted the common branch September 19, 2022 06:31
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