Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

This patch replaces the recursion with std::conjunction for
readability and brevity.

This patch replaces the recursion with std::conjunction for
readability and brevity.
@llvmbot
Copy link
Member

llvmbot commented Sep 18, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

This patch replaces the recursion with std::conjunction for
readability and brevity.


Full diff: https://github.com/llvm/llvm-project/pull/159509.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/ilist_node_options.h (+2-6)
diff --git a/llvm/include/llvm/ADT/ilist_node_options.h b/llvm/include/llvm/ADT/ilist_node_options.h
index 143195aa9c647..003d5dabce897 100644
--- a/llvm/include/llvm/ADT/ilist_node_options.h
+++ b/llvm/include/llvm/ADT/ilist_node_options.h
@@ -145,12 +145,8 @@ struct is_valid_option<ilist_parent<ParentTy>> : std::true_type {};
 /// Check whether options are valid.
 ///
 /// The conjunction of \a is_valid_option on each individual option.
-template <class... Options> struct check_options;
-template <> struct check_options<> : std::true_type {};
-template <class Option1, class... Options>
-struct check_options<Option1, Options...>
-    : std::bool_constant<is_valid_option<Option1>::value &&
-                         check_options<Options...>::value> {};
+template <class... Options>
+struct check_options : std::conjunction<is_valid_option<Options>...> {};
 
 /// Traits for options for \a ilist_node.
 ///

@kazutakahirata kazutakahirata merged commit deb9520 into llvm:main Sep 18, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250917_ADT_ilist_node_options_conjunction branch September 18, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants