Mungojerrie  1.0
Mungojerrie
Classes | Functions
Set.hh File Reference

Set manipulation functions. More...

#include <set>
#include <iostream>
#include <type_traits>
#include <vector>
#include <unordered_set>
#include <list>
#include <forward_list>
#include <deque>
#include <map>
#include <unordered_map>
#include <tuple>
#include <array>
Include dependency graph for Set.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  print_tuple_aux< T, Size >
 
struct  print_tuple_aux< T, 0 >
 

Functions

template<typename Set1 , typename Set2 >
bool disjoint (Set1 const &set1, Set2 const &set2)
 
template<typename Set1 , typename Set2 >
bool subsetOf (Set1 const &set1, Set2 const &set2)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > & operator|= (Set1 &lhs, Set2 const &rhs)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > operator| (Set1 set1, Set2 const &set2)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > & operator&= (Set1 &lhs, Set2 const &rhs)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > operator& (Set1 set1, Set2 const &set2)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > & operator-= (Set1 &lhs, Set2 const &rhs)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > operator- (Set1 set1, Set2 const &set2)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > & operator^= (Set1 &lhs, Set2 const &rhs)
 
template<typename Set1 , typename Set2 >
std::set< typename Set1::value_type > operator^ (Set1 set1, Set2 const &set2)
 
template<template< typename, typename... > class Container, typename T , typename = typename std::enable_if<std::is_same<std::vector<T>, Container<T> >::value || std::is_same<std::set<T>, Container<T> >::value || std::is_same<std::unordered_set<T>, Container<T> >::value || std::is_same<std::deque<T>, Container<T> >::value || std::is_same<std::list<T>, Container<T> >::value || std::is_same<std::forward_list<T>, Container<T> >::value >::type, typename ... Rest>
std::ostream & operator<< (std::ostream &os, Container< T, Rest... > const &s)
 
template<typename F , typename S >
std::ostream & operator<< (std::ostream &os, std::pair< F, S > const &p)
 
template<template< typename, typename... > class Container, typename Key , typename Val , typename = typename std::enable_if<std::is_same<std::map<Key, Val>, Container<Key, Val> >::value || std::is_same<std::unordered_map<Key, Val>, Container<Key, Val> >::value>::type, typename ... Rest>
std::ostream & operator<< (std::ostream &os, Container< Key, Val, Rest... > const &m)
 
template<typename T , size_t N>
std::ostream & operator<< (std::ostream &os, std::array< T, N > const &a)
 
template<typename T , typename = typename std::enable_if<!std::is_same<char, T>::value>::type, size_t N>
std::ostream & operator<< (std::ostream &os, T const (&a)[N])
 
template<typename ... Args>
std::ostream & operator<< (std::ostream &os, std::tuple< Args... > const &t)
 

Detailed Description

Set manipulation functions.

Author
Mateo Perez, Fabio Somenzi, Ashutosh Trivedi

Function Documentation

◆ disjoint()

template<typename Set1 , typename Set2 >
bool disjoint ( Set1 const &  set1,
Set2 const &  set2 
)

Checks whether set1 and set2 are disjoint.

◆ operator&()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type> operator& ( Set1  set1,
Set2 const &  set2 
)

Returns the intersection of set1 and set2.

◆ operator&=()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type>& operator&= ( Set1 &  lhs,
Set2 const &  rhs 
)

Removes the elements not in rhs from lhs.

◆ operator-()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type> operator- ( Set1  set1,
Set2 const &  set2 
)

Returns the set difference of set1 and set2.

◆ operator-=()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type>& operator-= ( Set1 &  lhs,
Set2 const &  rhs 
)

Removes the elements of rhs from lhs.

◆ operator^()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type> operator^ ( Set1  set1,
Set2 const &  set2 
)

Returns the symmetric difference of set1 and set2.

◆ operator^=()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type>& operator^= ( Set1 &  lhs,
Set2 const &  rhs 
)

Changes lhs to the symmetric difference of lhs and rhs.

◆ operator|()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type> operator| ( Set1  set1,
Set2 const &  set2 
)

Returns the union of set1 and set2.

◆ operator|=()

template<typename Set1 , typename Set2 >
std::set<typename Set1::value_type>& operator|= ( Set1 &  lhs,
Set2 const &  rhs 
)

Adds the elements of rhs to lhs.

◆ subsetOf()

template<typename Set1 , typename Set2 >
bool subsetOf ( Set1 const &  set1,
Set2 const &  set2 
)

Checks whether set1 is a subset of set2.