Skip to content

Commit

Permalink
[base] Remove base::conjunction
Browse files Browse the repository at this point in the history
Use C++17's std::conjunction instead.

R=leszeks@chromium.org

Bug: v8:12425
Change-Id: I004a1bb4fe1b09f441f8822075a72fd20fc90fec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3570429
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79803}
  • Loading branch information
backes authored and V8 LUCI CQ committed Apr 6, 2022
1 parent 30ba798 commit 4c99c01
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/base/once.h
Expand Up @@ -93,7 +93,7 @@ inline void CallOnce(OnceType* once, std::function<void()> init_func) {
}

template <typename... Args, typename = std::enable_if_t<
conjunction<std::is_scalar<Args>...>::value>>
std::conjunction_v<std::is_scalar<Args>...>>>
inline void CallOnce(OnceType* once,
typename FunctionWithArgs<Args...>::type init_func,
Args... args) {
Expand Down
9 changes: 0 additions & 9 deletions src/base/template-utils.h
Expand Up @@ -89,15 +89,6 @@ constexpr bool all(Args... rest) {
return fold(std::logical_and<>{}, true, rest...);
}

// Corresponds to C++17's std::conjunction
template <class...>
struct conjunction : std::true_type {};
template <class B>
struct conjunction<B> : B {};
template <class B, class... Bn>
struct conjunction<B, Bn...>
: std::conditional_t<bool(B::value), conjunction<Bn...>, B> {};

} // namespace base
} // namespace v8

Expand Down

0 comments on commit 4c99c01

Please sign in to comment.