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

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 12:38:13 PST 2016


zturner 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...>();
----------------
mehdi_amini wrote:
> 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)
Ahh I wasn't sure if that was still C++11.


https://reviews.llvm.org/D27314





More information about the llvm-commits mailing list