mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-30 11:02:39 -06:00
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
This commit is contained in:
parent
985cd878e6
commit
fa9d6b79f9
1 changed files with 1 additions and 1 deletions
|
@ -172,7 +172,7 @@ struct swap_struct_t {
|
||||||
using swapped_t = swap_struct_t;
|
using swapped_t = swap_struct_t;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
T value = T();
|
T value;
|
||||||
|
|
||||||
static T swap(T v) {
|
static T swap(T v) {
|
||||||
return F::swap(v);
|
return F::swap(v);
|
||||||
|
|
Loading…
Reference in a new issue