From 199b5267fe5d790dfb66f92f8e0b8fa6153ecd78 Mon Sep 17 00:00:00 2001 From: Simon Brand Date: Tue, 26 Mar 2019 14:56:22 +0000 Subject: [PATCH] Reorganise union members since this appears to help GCC optimize default construction --- tl/expected.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tl/expected.hpp b/tl/expected.hpp index 3299750..eb88d39 100644 --- a/tl/expected.hpp +++ b/tl/expected.hpp @@ -388,9 +388,9 @@ struct expected_storage_base { } } union { - char m_no_init; T m_val; unexpected m_unexpect; + char m_no_init; }; bool m_has_val; }; @@ -429,9 +429,9 @@ template struct expected_storage_base { ~expected_storage_base() = default; union { - char m_no_init; T m_val; unexpected m_unexpect; + char m_no_init; }; bool m_has_val; }; @@ -475,9 +475,9 @@ template struct expected_storage_base { } union { - char m_no_init; T m_val; unexpected m_unexpect; + char m_no_init; }; bool m_has_val; }; @@ -519,9 +519,9 @@ template struct expected_storage_base { } } union { - char m_no_init; T m_val; unexpected m_unexpect; + char m_no_init; }; bool m_has_val; }; @@ -550,8 +550,8 @@ template struct expected_storage_base { ~expected_storage_base() = default; struct dummy {}; union { - dummy m_val; unexpected m_unexpect; + dummy m_val; }; bool m_has_val; }; @@ -584,8 +584,8 @@ template struct expected_storage_base { } union { - char m_dummy; unexpected m_unexpect; + char m_dummy; }; bool m_has_val; };