summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Weiyi Wang2019-01-25 12:16:00 -0500
committerGravatar fearlessTobi2019-02-06 17:24:27 +0100
commit71530781f33423fc48c9bf43702f1291a38a259d (patch)
treee85db13aadb0ac8600e06ef7d0b9c08bfd25d2cb /src
parentcommon/swap: use template and tag for LE/BE specification (diff)
downloadyuzu-71530781f33423fc48c9bf43702f1291a38a259d.tar.gz
yuzu-71530781f33423fc48c9bf43702f1291a38a259d.tar.xz
yuzu-71530781f33423fc48c9bf43702f1291a38a259d.zip
common/swap: remove default value for swap type internal storage
This is compromise for swap type being used in union. A union has deleted default constructor if it has at least one variant member with non-trivial default constructor, and no variant member of T has a default member initializer. In the use case of Bitfield, all variant members will be the swap type on endianness mismatch, which would all have non-trivial default constructor if default value is specified, and non of them can have member initializer
Diffstat (limited to '')
-rw-r--r--src/common/swap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/swap.h b/src/common/swap.h
index 97aacb4dc..4b82865fe 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -172,7 +172,7 @@ struct swap_struct_t {
172 using swapped_t = swap_struct_t; 172 using swapped_t = swap_struct_t;
173 173
174protected: 174protected:
175 T value = T(); 175 T value;
176 176
177 static T swap(T v) { 177 static T swap(T v) {
178 return F::swap(v); 178 return F::swap(v);