Fix endian swapping classes reading volatile values twice.
This commit is contained in:
parent
3997116656
commit
cbf0c1dc97
1 changed files with 6 additions and 1 deletions
|
@ -128,7 +128,12 @@ public:
|
|||
__endian_base() { }
|
||||
__endian_base(const T& t) : representation(swap(t)) { }
|
||||
operator T() const { return swap(representation); }
|
||||
operator T() const volatile { return swap((const T) representation); }
|
||||
operator T() const volatile
|
||||
{
|
||||
T value = representation;
|
||||
__endian_base<T, endianness> wrapper(value);
|
||||
return wrapper.representation;
|
||||
}
|
||||
|
||||
__endian_base& operator=(const T& rhs)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue