Commit ac2bd78f authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[base] Remove base::is_same

Use C++17's std::conjunction together with std::is_same instead.

R=leszeks@chromium.org

Bug: v8:12425
Change-Id: I75a973f14f0642b00d390aa6ab4eb1ce0208c074
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568478Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79848}
parent 884e2749
...@@ -60,16 +60,6 @@ struct has_output_operator< ...@@ -60,16 +60,6 @@ struct has_output_operator<
T, TStream, decltype(void(std::declval<TStream&>() << std::declval<T>()))> T, TStream, decltype(void(std::declval<TStream&>() << std::declval<T>()))>
: std::true_type {}; : std::true_type {};
// {is_same<Ts...>::value} is true if all Ts are the same, false otherwise.
template <typename... Ts>
struct is_same : public std::false_type {};
template <>
struct is_same<> : public std::true_type {};
template <typename T>
struct is_same<T> : public std::true_type {};
template <typename T, typename... Ts>
struct is_same<T, T, Ts...> : public is_same<T, Ts...> {};
} // namespace base } // namespace base
} // namespace v8 } // namespace v8
......
...@@ -22,9 +22,9 @@ constexpr bool ShouldPadArguments(int argument_count) { ...@@ -22,9 +22,9 @@ constexpr bool ShouldPadArguments(int argument_count) {
#ifdef DEBUG #ifdef DEBUG
template <typename... RegTypes, template <typename... RegTypes,
// All arguments must be either Register or DoubleRegister. // All arguments must be either Register or DoubleRegister.
typename = typename std::enable_if< typename = typename std::enable_if_t<
base::is_same<Register, RegTypes...>::value || std::conjunction_v<std::is_same<Register, RegTypes>...> ||
base::is_same<DoubleRegister, RegTypes...>::value>::type> std::conjunction_v<std::is_same<DoubleRegister, RegTypes>...>>>
inline constexpr bool AreAliased(RegTypes... regs) { inline constexpr bool AreAliased(RegTypes... regs) {
int num_different_regs = RegListBase{regs...}.Count(); int num_different_regs = RegListBase{regs...}.Count();
int num_given_regs = (... + (regs.is_valid() ? 1 : 0)); int num_given_regs = (... + (regs.is_valid() ? 1 : 0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment