Use hex::integral instead of std::integral concept
This commit is contained in:
parent
9a968674d6
commit
4189700a3b
@ -12,7 +12,6 @@
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#include <winsock.h>
|
||||
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
@ -94,7 +93,7 @@ namespace hex {
|
||||
return (value & mask) >> to;
|
||||
}
|
||||
|
||||
template<std::integral T>
|
||||
template<hex::integral T>
|
||||
[[nodiscard]] constexpr inline T signExtend(T value, u8 currWidth, u8 targetWidth) {
|
||||
T mask = 1LLU << (currWidth - 1);
|
||||
return (((value ^ mask) - mask) << ((sizeof(T) * 8) - targetWidth)) >> ((sizeof(T) * 8) - targetWidth);
|
||||
|
Loading…
Reference in New Issue
Block a user