From 6d0bcff38a6a82521011392d71a0405ac4638d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 3 Nov 2020 09:40:01 +0100 Subject: [PATCH] Fix compilation error for MSVC 10 x86 in aligned_union --- include/boost/move/detail/type_traits.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/boost/move/detail/type_traits.hpp b/include/boost/move/detail/type_traits.hpp index f2a48db..2d49ace 100644 --- a/include/boost/move/detail/type_traits.hpp +++ b/include/boost/move/detail/type_traits.hpp @@ -1060,8 +1060,9 @@ BOOST_MOVE_ALIGNED_STRUCT(4096); template union aligned_union { - aligned_struct aligner; - unsigned char data[Len]; + typedef aligned_struct aligner_t; + aligner_t aligner; + unsigned char data[Len > sizeof(aligner_t) ? Len : sizeof(aligner_t)]; }; template @@ -1106,7 +1107,7 @@ template union aligned_struct_wrapper { aligned_struct aligner; - unsigned char data[sizeof(aligned_struct)]; + unsigned char data[Len > sizeof(aligner) ? Len : sizeof(aligner)]; }; template @@ -1121,7 +1122,7 @@ template union aligned_union { T aligner; - unsigned char data[Len]; + unsigned char data[Len > sizeof(aligner) ? Len : sizeof(aligner)]; }; template