uint64_t author.value = 0;
uint64_t timestamp = 1577369253;
uint128_t skey = static_cast<uint128_t>(author.value) << 64 | timestamp;
skey的价值是什么?无论时间戳的值如何,我都将其设置为零。可能是什么原因?
答案 0 :(得分:0)
这应该有助于您停止担心该问题:
uint128_t skey = (static_cast<uint128_t>(author.value) << 64) | timestamp;
据此,按位移位(7)的优先级高于按位移位(13)的优先级: https://en.cppreference.com/w/cpp/language/operator_precedence