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:
parent
0e6538a511
commit
0790c01f44
|
@ -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 };
|
||||
|
|
Loading…
Reference in New Issue