forked from simongog/sdsl-lite
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue simongog#202 and introduce more type safety
This fixes issue simongog#202 where I added stuff to the invector before updating the size. Additionally, this commit also adds additional type safety features to the int-vector-mapper. The mapper now has an additional template parameter: ` template <t_width,t_mode> class int_vector_mapper ` where the ``open mode'' can be specified. For example, ` const int_vector_mapper<0,std::ios_base::in> ivm(tmp_file); ` maps a file in read only mode. thus, only operations which do not modify the underlying file are permitted. Using other operations causes a compilation error. The default mode remains read+write so existing code is not affected: ` int_vector_mapper<0,std::ios_base::out|std::ios_base::in> ivm(tmp_file); ` is equal to ` int_vector_mapper<> ivm(tmp_file); ` the examples and tests are adjusted accordingly.
- Loading branch information
Showing
4 changed files
with
380 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.