BitMagic-C++
Functions
sample19.cpp File Reference

Example: bit-vector merge. More...

#include <stdlib.h>
#include <iostream>
#include "bm.h"
Include dependency graph for sample19.cpp:

Go to the source code of this file.

Functions

int main (void)
 

Detailed Description

Example: bit-vector merge.

Merge operation is an equivalent of logical OR, except it destroys the argument. This is done to more efficiently transfer the information to the target vector by re-assigning memory blocks, instead of doing allocation, copy and logical OR.

After merge the argument vector will have undefined content, so it is better to clear or destroy it.

Typical use case is to merge vectors after some multi-threaded partitioned processing.

Definition in file sample19.cpp.

Function Documentation

◆ main()

int main ( void  )
Examples
sample19.cpp.

Definition at line 47 of file sample19.cpp.

References bm::bvector< Alloc >::count().