[PATCH] D27314: Replace AlignedCharArrayUnion maxed arity with a variadic template

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 12:03:05 PST 2016


mehdi_amini added inline comments.


================
Comment at: llvm/include/llvm/Support/AlignOf.h:38-40
+  return (max_alignof<T0>() > max_alignof<T1, Ts...>())
+             ? max_alignof<T0>()
+             : max_alignof<T1, Ts...>();
----------------
zturner wrote:
> How about 
> 
> ```
> constexpr size_t lhs = max_alignof<T0>();
> constexpr size_t rhs = max_alignof<T1, Ts...>();
> return std::max(lhs, rhs);
> ```
> 
> 
I tried this first but got a warning because this isn't c++11 (only c++14)


https://reviews.llvm.org/D27314





More information about the llvm-commits mailing list