| 77 | |
| 78 | public: |
| 79 | static std::unique_ptr<TSelf> Create(TReader const & reader) |
| 80 | { |
| 81 | TSize const size = ReadPrimitiveFromPos<TSize>(reader, 0); |
| 82 | |
| 83 | uint64_t const off1 = sizeof(TSize); |
| 84 | uint64_t const off2 = AlignBytesCount((size * Bits + CHAR_BIT - 1) / CHAR_BIT) + off1; |
| 85 | |
| 86 | // We cannot use make_unique here because contsructor is private. |
| 87 | return std::unique_ptr<TSelf>( |
| 88 | new TSelf(reader.SubReader(off1, off2 - off1), reader.SubReader(off2, reader.Size() - off2), size)); |
| 89 | } |
| 90 | |
| 91 | bool Get(TSize index, TValue & value) const |
| 92 | { |