Avoid narrowing conversion in `optional`

This issue was causing compile warnings on Ubuntu 18, when compiling
with conversion warnings enabled. The result of `size_of` was being
converted to `unsigned` which is a narrowing conversion on 64 bit
platforms. This commit fixes this issue by changing the type to
`std::size_t`, which is large enough to store the resultof `size_of`
without a narrowing conversion.
This commit is contained in:
Thomas Spriggs 2019-02-04 11:23:45 +00:00
parent 0e6538a511
commit 0790c01f44
1 changed files with 1 additions and 1 deletions

View File

@ -356,7 +356,7 @@ struct alignment_of_hack
alignment_of_hack();
};
template <unsigned A, unsigned S>
template <std::size_t A, std::size_t S>
struct alignment_logic
{
enum { value = A < S ? A : S };