Dynamic array test

This commit is contained in:
Pavel Kirienko
2014-02-24 14:14:45 +04:00
parent da4c2b524b
commit 01b45c892d
5 changed files with 137 additions and 3 deletions
@@ -87,7 +87,7 @@ protected:
public:
SizeType size() const
{
assert(size_ <= MaxSize);
assert(size_ ? ((size_ - 1u) <= (MaxSize - 1u)) : 1); // -Werror=type-limits
return size_;
}
@@ -212,6 +212,7 @@ public:
enum { IsDynamic = ArrayMode == ArrayModeDynamic };
enum { MaxSize = MaxSize_ };
enum { MinBitLen = IsDynamic ? 0 : (RawValueType::MinBitLen * MaxSize) };
enum { MaxBitLen = RawValueType::MaxBitLen * MaxSize };
static int encode(const SelfType& array, ScalarCodec& codec)
{