Expose template parameters of endian specific types as class members

Summary:
This allows generic code to query these parameters, and is a common
practice in a lot of other template classes.

Reviewers: zturner, Bigcheese

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58969

llvm-svn: 355504
This commit is contained in:
Pavel Labath 2019-03-06 14:09:02 +00:00
parent 5f0b7d2f46
commit 89eb7bb3f6
1 changed files with 7 additions and 3 deletions

View File

@ -203,10 +203,14 @@ inline void writeAtBitAlignment(void *memory, value_type value,
namespace detail {
template<typename value_type,
endianness endian,
std::size_t alignment>
template<typename ValueType,
endianness Endian,
std::size_t Alignment>
struct packed_endian_specific_integral {
using value_type = ValueType;
static constexpr endianness endian = Endian;
static constexpr std::size_t alignment = Alignment;
packed_endian_specific_integral() = default;
explicit packed_endian_specific_integral(value_type val) { *this = val; }