[PATCH] D23252: [ADT] Extra STLExtras

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 10:28:18 PDT 2016


dblaikie added a comment.

(might want to update the description to remove the mention of copy/copy_if now that they've been moved into a separate patch & make the title more specifically about zip range adapter, etc)


================
Comment at: include/llvm/ADT/STLExtras.h:241-243
@@ +240,5 @@
+
+template <typename B, typename... Bs> constexpr bool all_true(B b, Bs... rest) {
+  return b && all_true(rest...);
+}
+
----------------
Recursive implementations only used in constexpr contexts are fine - but a recursive implementation used in a non-constexpr context may still be implemented recursively by the compiler & is usually best avoided. (this is a problem with constexpr currently - where the ideal implementation for constexpr is not the same as the ideal implementation for non-constexpr contexts)

& this isn't being called in a constexpr context, so I'm not sure of the value of flagging it as constexpr or designing it in a way that would be valid constexpr.


Repository:
  rL LLVM

https://reviews.llvm.org/D23252





More information about the llvm-commits mailing list