simongog/sdsl-lite — pull request #187 by mpetri (2014-05-27 01:03:18+00:00)
Title: Add memory mapped int_vector  and simplify int_vec

This commit introduces a non-const data() member which allows raw
write access to the data stored in an int_vector similar to what is
possible with the standard std::vector. this allows "unfriending"
several of the util:: helper functions that modify int_vectors.

The second addition to the library is a memory mapped int_vector
(int_vector_mapper) which provides the same functionality as a regular
int_vector but is memory mapped from a file. Thus, operations such as
util::bit_compress can now be performed without loading the int_vector
to memory. The int_vector_mapper is solely used as a resource handle to
the data stored in the file. All operations are forwarded to the
int_vector implementation. Thus, unlike the int_vector_buffer, the
mapper can be used in regular stl algorithms as it provides const and
non const access similar to the regular int_vector. The mapper
additionally supports the push_back and resize operations which can be
used to write data to disk.

Temporary storage on disk can be realized using the temp_file_buffer
class which creates a int_vector_mapper object from a temporary file
which is deleted after the int_vector_mapper object is destroyed.