mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-16 00:46:03 +08:00
Updated bit_cast
This commit is contained in:
parent
9bea87dd90
commit
cb243f78ca
@ -58,14 +58,7 @@ namespace etl
|
||||
{
|
||||
TDestination destination;
|
||||
|
||||
const char* s = &source;
|
||||
char* d = &destination;
|
||||
char* const de = d + sizeof(TDestination);
|
||||
|
||||
while (d != de)
|
||||
{
|
||||
*d++ = *s++;
|
||||
}
|
||||
memcpy(&destination, &source, sizeof(TDestination));
|
||||
|
||||
return destination;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user