| 65 | /// Convenience wrapper to unpack into a vector |
| 66 | template <typename Int> |
| 67 | std::vector<Int> UnpackValues(const uint8_t* packed, const UnpackOptions& opts, |
| 68 | UnpackFunc<Int> unpack) { |
| 69 | if constexpr (std::is_same_v<Int, bool>) { |
| 70 | // Using dynamic array to avoid std::vector<bool> |
| 71 | auto buffer = std::make_unique<Int[]>(opts.batch_size); |
| 72 | unpack(packed, buffer.get(), opts); |
| 73 | return std::vector<Int>(buffer.get(), buffer.get() + opts.batch_size); |
| 74 | } else { |
| 75 | std::vector<Int> out(opts.batch_size); |
| 76 | unpack(packed, out.data(), opts); |
| 77 | return out; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /// Use BitWriter to pack values into a vector. |
| 82 | template <typename Int> |
no test coverage detected