STL Memory Versioning
Public Member Functions | List of all members
vs::vs_set_strategy< _Key, _Comp > Class Template Reference

simpliest determenistic merge strategy. More...

#include <vs_set.h>

Public Member Functions

void merge (std::set< _Key, _Comp > &dst, std::set< _Key, _Comp > &src)
 
void merge_same_element (std::set< _Key, _Comp > &dst, _Key &dstk, _Key &srck)
 

Detailed Description

template<typename _Key, typename _Comp>
class vs::vs_set_strategy< _Key, _Comp >

simpliest determenistic merge strategy.

On merge, puts everything from one set to other. It is expected to start with empty stacks and merge remainders, or for user to override this strategy.

Merge_same_element is empty, user is expected to override it for actually merging same elements.

Definition at line 163 of file vs_set.h.

Member Function Documentation

◆ merge()

template<typename _Key , typename _Comp >
void vs::vs_set_strategy< _Key, _Comp >::merge ( std::set< _Key, _Comp > &  dst,
std::set< _Key, _Comp > &  src 
)
inline

Definition at line 168 of file vs_set.h.

169  {
170  for (auto& i: src)
171  {
172  auto found = dst.find(i);
173  /* XXX: dirty const_cast, but it is not used as const anyway */
174  if (found != dst.end())
175  merge_same_element(dst, const_cast<_Key&>(*found), const_cast<_Key&>(i));
176  else
177  dst.insert(i);
178  }
179  }
void merge_same_element(std::set< _Key, _Comp > &dst, _Key &dstk, _Key &srck)
Definition: vs_set.h:182

◆ merge_same_element()

template<typename _Key , typename _Comp >
void vs::vs_set_strategy< _Key, _Comp >::merge_same_element ( std::set< _Key, _Comp > &  dst,
_Key &  dstk,
_Key &  srck 
)
inline

Definition at line 182 of file vs_set.h.

183  {
184  /* do nothing, as insert would handle it */
185  }

The documentation for this class was generated from the following file: