Don't delete BitField copy assignment operator on VS
This commit is contained in:
parent
9a2745a977
commit
983b986303
|
@ -124,15 +124,18 @@ public:
|
||||||
// so that we can use this within unions
|
// so that we can use this within unions
|
||||||
constexpr BitField() = default;
|
constexpr BitField() = default;
|
||||||
|
|
||||||
|
// Visual Studio (as of VS2017) considers BitField to not be trivially
|
||||||
|
// copyable if we delete this copy assignment operator.
|
||||||
|
// https://developercommunity.visualstudio.com/content/problem/101208/c-compiler-is-overly-strict-regarding-whether-a-cl.html
|
||||||
|
#ifndef _MSC_VER
|
||||||
// We explicitly delete the copy assignment operator here, because the
|
// We explicitly delete the copy assignment operator here, because the
|
||||||
// default copy assignment would copy the full storage value, rather than
|
// default copy assignment would copy the full storage value, rather than
|
||||||
// just the bits relevant to this particular bit field.
|
// just the bits relevant to this particular bit field.
|
||||||
// Ideally, we would just implement the copy assignment to copy only the
|
// Ideally, we would just implement the copy assignment to copy only the
|
||||||
// relevant bits, but this requires compiler support for unrestricted
|
// relevant bits, but we're prevented from doing that because the savestate
|
||||||
// unions.
|
// code expects that this class is trivially copyable.
|
||||||
// TODO: Implement this operator properly once all target compilers
|
|
||||||
// support unrestricted unions.
|
|
||||||
BitField& operator=(const BitField&) = delete;
|
BitField& operator=(const BitField&) = delete;
|
||||||
|
#endif
|
||||||
|
|
||||||
__forceinline BitField& operator=(T val)
|
__forceinline BitField& operator=(T val)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue