File: int-vector-buffer-iterator.cpp

package info (click to toggle)
seqan3 3.0.2%2Bds-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,052 kB
  • sloc: cpp: 144,641; makefile: 1,288; ansic: 294; sh: 228; xml: 217; javascript: 50; python: 27; php: 25
file content (22 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <sdsl/vectors.hpp>
#include <iostream>
#include <algorithm>

using namespace sdsl;
using namespace std;

int main()
{
    string file = "int_vector_buffer_iterator.sdsl";
    {
        int_vector<> iv = {1,2,3,4,5,9,8,7,6};
        store_to_file(iv, file);
    }
    int_vector_buffer<> ivb(file);
    cout << std::accumulate(ivb.begin(), ivb.end(), 0) << endl;
    cout << std::count_if(ivb.begin(), ivb.end(), [](uint64_t x) {
        return 0 == x%2;
    }) << endl;
}