This is an archive of the discontinued LLVM Phabricator instance.

Replace AlignedCharArrayUnion maxed arity with a variadic template
Needs ReviewPublic

Authored by mehdi_amini on Dec 1 2016, 11:56 AM.

Details

Reviewers
dblaikie
zturner
Summary

This is NFC but for lifting the limitation to 10 types.

Event Timeline

mehdi_amini retitled this revision from to Replace AlignedCharArrayUnion maxed arity with a variadic template.
mehdi_amini updated this object.
mehdi_amini added reviewers: zturner, dblaikie.
mehdi_amini added a subscriber: llvm-commits.
zturner added inline comments.Dec 1 2016, 12:00 PM
llvm/include/llvm/Support/AlignOf.h
38–40

How about

constexpr size_t lhs = max_alignof<T0>();
constexpr size_t rhs = max_alignof<T1, Ts...>();
return std::max(lhs, rhs);
mehdi_amini added inline comments.Dec 1 2016, 12:03 PM
llvm/include/llvm/Support/AlignOf.h
38–40

I tried this first but got a warning because this isn't c++11 (only c++14)

zturner added inline comments.Dec 1 2016, 12:38 PM
llvm/include/llvm/Support/AlignOf.h
38–40

Ahh I wasn't sure if that was still C++11.