forked from boostorg/beast
Assert on type size invariant
This commit is contained in:
1 parent
0008193a20
commit
e2fd51c282
2 files changed
+4
-2
No files matched your search
@@ -76,10 +76,10 @@ public:
|
||||
template <class IntegerType>
|
||||
UnsignedInteger <Bytes>& operator= (IntegerType value)
|
||||
{
|
||||
static_bassert (sizeof (Bytes) >= sizeof (IntegerType));
|
||||
static_bassert (Bytes >= sizeof (IntegerType));
|
||||
clear ();
|
||||
value = ByteOrder::swapIfLittleEndian (value);
|
||||
memcpy (end () - sizeof (value), &value, sizeof (value));
|
||||
memcpy (end () - sizeof (value), &value, bmin (Bytes, sizeof (value)));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user