OGS
Algorithm.h File Reference

Detailed Description

Definition in file Algorithm.h.

#include <algorithm>
#include <cassert>
#include <concepts>
#include <optional>
#include <range/v3/algorithm/find_if.hpp>
#include <range/v3/range/concepts.hpp>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <utility>
#include "CompilerWorkarounds.h"
#include "Error.h"
Include dependency graph for Algorithm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BaseLib::Overloaded< Ts >
 

Namespaces

namespace  BaseLib
 

Functions

template<typename T >
std::vector< T > BaseLib::excludeObjectCopy (std::vector< T > const &src_vec, std::vector< std::size_t > const &exclude_positions)
 
template<typename T >
void BaseLib::excludeObjectCopy (std::vector< T > const &src_vec, std::vector< std::size_t > const &exclude_positions, std::vector< T > &dest_vec)
 
template<ranges::input_range Range>
ranges::range_reference_t< RangeBaseLib::findElementOrError (Range &range, std::predicate< ranges::range_reference_t< Range > > auto &&predicate, std::invocable auto error_callback)
 
template<typename Map , typename Key , typename Value >
void BaseLib::insertIfKeyUniqueElseError (Map &map, Key const &key, Value &&value, std::string const &error_message)
 
template<typename Map , typename Key >
OGS_NO_DANGLING Map::mapped_type & BaseLib::getOrError (Map &map, Key const &key, std::string const &error_message)
 
template<typename Map , typename Key >
OGS_NO_DANGLING Map::mapped_type const & BaseLib::getOrError (Map const &map, Key const &key, std::string const &error_message)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Container , typename Predicate >
OGS_NO_DANGLING Container::value_type const & BaseLib::getIfOrError (Container const &container, Predicate &&predicate, std::string const &error_message)
 
template<typename T >
void BaseLib::makeVectorUnique (std::vector< T > &v)
 
template<typename T , class Compare >
void BaseLib::makeVectorUnique (std::vector< T > &v, Compare comp)
 
template<typename ValueType , typename IndexType >
void BaseLib::reorderVector (std::vector< ValueType > &v, std::vector< IndexType > const &order)
 
template<typename Container >
void BaseLib::uniquePushBack (Container &container, typename Container::value_type const &element)
 
template<typename Container >
std::optional< typename Container::value_type > BaseLib::findFirstNotEqualElement (Container const &container, typename Container::value_type const &element)
 
template<typename Container >
std::size_t BaseLib::findIndex (Container const &container, typename Container::value_type const &element)
 
template<typename T >
void BaseLib::cleanupVectorElements (std::vector< T * > &items)
 
template<typename T1 , typename... Args>
void BaseLib::cleanupVectorElements (std::vector< T1 * > &dependent_items, Args &&... args)
 
template<typename List >
constexpr bool BaseLib::any_of (List const &values)
 Checks if any of the elements in the given list is true.
 
template<typename List >
constexpr bool BaseLib::all_of (List const &values)
 Checks if all of the elements in the given list are true.
 
template<typename List >
constexpr bool BaseLib::none_of (List const &values)
 Checks if none of the elements in the given list are true.