From 47e147c212dd858a23beb6c86708fa1cccd90136 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Nov 2018 13:54:00 +0200 Subject: Improve optional class template implementation --- libbutl/optional.mxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbutl/optional.mxx') diff --git a/libbutl/optional.mxx b/libbutl/optional.mxx index 0f18c11..470c608 100644 --- a/libbutl/optional.mxx +++ b/libbutl/optional.mxx @@ -43,7 +43,7 @@ LIBBUTL_MODEXPORT namespace butl template struct optional_data { - struct empty {char x;}; // Note: byte size is important to GCC. + struct empty {char x[sizeof(T)];}; // Note: data member important to GCC. union { @@ -86,7 +86,7 @@ LIBBUTL_MODEXPORT namespace butl template struct optional_data { - struct empty {char x;}; // Note: byte size is important to GCC. + struct empty {char x[sizeof(T)];}; // Note: data member important to GCC. union { -- cgit v1.1