template<class T, typename Compare = std::less<>>
BWAPI::SetContainer class

This container is used to wrap convenience functions for BWAPI and be used as a bridge with a built-in set type.

Template parameters
T Type that this set contains.
Compare Function to ensure ordering.

Contents

Derived classes

class Unitset

Public functions

auto contains(T const& value) const -> bool
Checks if this set contains a specific value.
template<class Pred>
auto erase_if(Pred&& pred) -> SetContainer<T, Compare>&
Iterates the set and erases each element x where pred(x) returns true.
template<class Pred>
auto find_if(Pred&& pred) const -> SetContainer<T, Compare>::iterator
Iterates the set and finds the first element where pred(x) returns true.

Function documentation

template<class T, typename Compare>
bool BWAPI::SetContainer<T, Compare>::contains(T const& value) const

Checks if this set contains a specific value.

Parameters
value Value to search for.

template<class T, typename Compare> template<class Pred>
SetContainer<T, Compare>& BWAPI::SetContainer<T, Compare>::erase_if(Pred&& pred)

Iterates the set and erases each element x where pred(x) returns true.

Parameters
pred Predicate for removing elements.

template<class T, typename Compare> template<class Pred>
SetContainer<T, Compare>::iterator BWAPI::SetContainer<T, Compare>::find_if(Pred&& pred) const

Iterates the set and finds the first element where pred(x) returns true.

Parameters
pred Predicate for searching.