本文整理汇总了C++中BitVector::ReadLong方法的典型用法代码示例。如果您正苦于以下问题:C++ BitVector::ReadLong方法的具体用法?C++ BitVector::ReadLong怎么用?C++ BitVector::ReadLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitVector
的用法示例。
在下文中一共展示了BitVector::ReadLong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Test_bitVectorCtors
void BitVector_Test::Test_bitVectorCtors()
{
{
BitVector<10> bv;
assert(bv.Read(0,10)==0);
}
{
BitVector<30> bv;
assert(bv.Read(0,30)==0);
}
{
BitVector<60> bv;
assert(bv.ReadLong(0,60)==0);
}
{
BitVector<12> bv(0x1234);
assert(bv.Read(0,12)==0x234);
}
{
BitVector<30> bv(0xdeadbeef);
assert(bv.Read(0,30)==0x1eadbeef);
}
{
BitVector<60> bv(0xdeadbeef);
assert(bv.ReadLong(0,60)==0xdeadbeef);
}
}
示例2: Test_bitVectorLong
void BitVector_Test::Test_bitVectorLong()
{
BitVector<256>* bits = setup();
assert(bits->ReadLong(16, 64) == HexU64(0x13571112,0x13141234));
assert(bits->ReadLong(0, 32) == HexU64(0x0,0x24681357));
assert(bits->ReadLong(96, 32) == HexU64(0x0,0x9abcdef0));
assert(bits->ReadLong(160, 36) == HexU64(0x8,0x76543214));
bits->WriteLong(16,64,HexU64(0x13000012,0x13141234));
assert(bits->ReadLong(16, 64) == HexU64(0x13000012,0x13141234));
bits->WriteLong(24,16,0x5711L);
assert(bits->ReadLong(16, 64) == HexU64(0x13571112,0x13141234));
bits->WriteLong(192,64,0x0L);
assert(bits->ReadLong(160, 64) == HexU64(0x87654321,0x00000000));
assert(bits->ReadLong(192, 64) == 0x0L);
bits->WriteLong(192,64,(u64) -1L);
assert(bits->ReadLong(192, 64) == (u64) -1L);
}