Mungojerrie
1.1
Mungojerrie
|
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>
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) |
Set manipulation functions.
Copyright (c) 2021, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bool disjoint | ( | Set1 const & | set1, |
Set2 const & | set2 | ||
) |
Checks whether set1 and set2 are disjoint.
std::set<typename Set1::value_type> operator& | ( | Set1 | set1, |
Set2 const & | set2 | ||
) |
Returns the intersection of set1 and set2.
std::set<typename Set1::value_type>& operator&= | ( | Set1 & | lhs, |
Set2 const & | rhs | ||
) |
Removes the elements not in rhs from lhs.
std::set<typename Set1::value_type> operator- | ( | Set1 | set1, |
Set2 const & | set2 | ||
) |
Returns the set difference of set1 and set2.
std::set<typename Set1::value_type>& operator-= | ( | Set1 & | lhs, |
Set2 const & | rhs | ||
) |
Removes the elements of rhs from lhs.
std::set<typename Set1::value_type> operator^ | ( | Set1 | set1, |
Set2 const & | set2 | ||
) |
Returns the symmetric difference of set1 and set2.
std::set<typename Set1::value_type>& operator^= | ( | Set1 & | lhs, |
Set2 const & | rhs | ||
) |
Changes lhs to the symmetric difference of lhs and rhs.
std::set<typename Set1::value_type> operator| | ( | Set1 | set1, |
Set2 const & | set2 | ||
) |
Returns the union of set1 and set2.
std::set<typename Set1::value_type>& operator|= | ( | Set1 & | lhs, |
Set2 const & | rhs | ||
) |
Adds the elements of rhs to lhs.
bool subsetOf | ( | Set1 const & | set1, |
Set2 const & | set2 | ||
) |
Checks whether set1 is a subset of set2.