From 0790c01f44ccdb8c376ddcf187cb54cb3e62644e Mon Sep 17 00:00:00 2001 From: Thomas Spriggs Date: Mon, 4 Feb 2019 11:23:45 +0000 Subject: [PATCH] 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. --- src/nonstd/optional.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nonstd/optional.hpp b/src/nonstd/optional.hpp index 2634200523..816af18523 100644 --- a/src/nonstd/optional.hpp +++ b/src/nonstd/optional.hpp @@ -356,7 +356,7 @@ struct alignment_of_hack alignment_of_hack(); }; -template +template struct alignment_logic { enum { value = A < S ? A : S };