finish api setup, ready to connect

This commit is contained in:
2024-07-30 03:04:30 +00:00
parent f8b4896b7c
commit 33e2120130
10 changed files with 604 additions and 18 deletions

View File

@ -80,12 +80,12 @@ concept int_or_bit = int_type<_Tp> || bit_type<std::decay_t<_Tp>>;
template<bit_type _Tp, int_or_bit _Up>
constexpr auto operator<<(const _Tp &lhs, const _Up &rhs) {
return Bit<_Tp::_Bit_Len>(cast(lhs) << (cast(rhs) & kMaxLength));
return Bit<_Tp::_Bit_Len>(cast(lhs) << (cast(rhs) & (kMaxLength - 1)));
}
template<bit_type _Tp, int_or_bit _Up>
constexpr auto operator>>(const _Tp &lhs, const _Up &rhs) {
return Bit<_Tp::_Bit_Len>(cast(lhs) >> (cast(rhs) & kMaxLength));
return Bit<_Tp::_Bit_Len>(cast(lhs) >> (cast(rhs) & (kMaxLength - 1)));
}
template<bit_type _Tp>