diff options
author | trav90 <travawine@palemoon.org> | 2018-09-19 18:59:49 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2018-09-19 18:59:49 -0500 |
commit | a50189e8d1ae7e890511fbdbae046dc04e1229e9 (patch) | |
tree | 51fd98a35bdfda06b79f74d6cf1ca5b4b1d9fda2 /js | |
parent | 84ce90713dab1510fbc681dcf5d2f86dc881df52 (diff) | |
download | aura-central-a50189e8d1ae7e890511fbdbae046dc04e1229e9.tar.gz |
Give uint8_clamped a defaulted (and also trivial) default constructor, copy constructor, and copy-assignment operator.
This also allows uint8_clamped to be permissibly memmove'd and memcpy'd.
Diffstat (limited to 'js')
-rw-r--r-- | js/src/vm/ArrayBufferObject.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/js/src/vm/ArrayBufferObject.h b/js/src/vm/ArrayBufferObject.h index 6614f5220..e9c9bc0e0 100644 --- a/js/src/vm/ArrayBufferObject.h +++ b/js/src/vm/ArrayBufferObject.h @@ -457,8 +457,8 @@ ClampDoubleToUint8(const double x); struct uint8_clamped { uint8_t val; - uint8_clamped() { } - uint8_clamped(const uint8_clamped& other) : val(other.val) { } + uint8_clamped() = default; + uint8_clamped(const uint8_clamped& other) = default; // invoke our assignment helpers for constructor conversion explicit uint8_clamped(uint8_t x) { *this = x; } @@ -469,10 +469,7 @@ struct uint8_clamped { explicit uint8_clamped(int32_t x) { *this = x; } explicit uint8_clamped(double x) { *this = x; } - uint8_clamped& operator=(const uint8_clamped& x) { - val = x.val; - return *this; - } + uint8_clamped& operator=(const uint8_clamped& x) = default; uint8_clamped& operator=(uint8_t x) { val = x; |