opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
algorithms.h File Reference
#include <liboscar/concepts/associative_container.h>
#include <liboscar/concepts/associative_container_key_for.h>
#include <algorithm>
#include <concepts>
#include <functional>
#include <iterator>
#include <memory>
#include <optional>
#include <ranges>
#include <stdexcept>
#include <type_traits>
#include <utility>
Include dependency graph for algorithms.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  osc
 

Functions

template<class T , class Proj = std::identity, std::indirect_strict_weak_order< std::projected< const T *, Proj > > Comp = std::ranges::less>
constexpr const Tosc::max (const T &a, const T &b, Comp comp={}, Proj proj={})
 
template<class T , class Proj = std::identity, std::indirect_strict_weak_order< std::projected< const T *, Proj > > Comp = std::ranges::less>
constexpr const Tosc::min (const T &a, const T &b, Comp comp={}, Proj proj={})
 
template<class T , class Proj = std::identity, std::indirect_strict_weak_order< std::projected< const T *, Proj > > Comp = std::ranges::less>
constexpr const Tosc::clamp (const T &v, const T &lo, const T &hi, Comp comp={}, Proj proj={})
 
template<std::ranges::random_access_range R, class Proj = std::identity, std::indirect_strict_weak_order< std::projected< std::ranges::iterator_t< R >, Proj > > Comp = std::ranges::less>
constexpr std::ranges::range_size_t< Rosc::max_element_index (R &&r, Comp comp={}, Proj proj={})
 
template<std::ranges::random_access_range R>
requires std::ranges::borrowed_range<R>
constexpr std::ranges::range_reference_t< Rosc::at (R &&r, std::ranges::range_size_t< R > pos)
 
template<std::ranges::input_range R, typename T , typename Proj = std::identity>
requires std::indirect_binary_predicate<std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T*>
std::optional< std::ranges::range_value_t< R > > osc::find_or_nullopt (R &&r, const T &value, Proj proj={})
 
template<AssociativeContainer Lookup, AssociativeContainerKeyFor< Lookup > Key>
std::optional< typename Lookup::mapped_type > osc::lookup_or_nullopt (const Lookup &lookup, const Key &key)
 
template<std::ranges::input_range R, typename T , typename Proj = std::identity>
requires std::ranges::borrowed_range<R>
auto osc::find_or_nullptr (R &&r, const T &value, Proj proj={}) -> decltype(std::addressof(*std::ranges::begin(r)))
 
template<AssociativeContainer T, AssociativeContainerKeyFor< T > Key>
autoosc::lookup_or_nullptr (const T &container, const Key &key)
 
template<AssociativeContainer T, AssociativeContainerKeyFor< T > Key>
autoosc::lookup_or_nullptr (T &container, const Key &key)
 
template<typename Downcasted , typename T1 , typename T2 >
requires std::equality_comparable<Downcasted>
and std::is_polymorphic_v< Downcasted > and std::derived_from< Downcasted, T1 > and std::derived_from< Downcasted, T2 > constexpr bool osc::is_eq_downcasted (const T1 &lhs, const T2 &rhs)
 
constexpr void osc::append_range (R1 &r1, R2 &&r2)
 

Variables

template<std::ranges::range R1, std::ranges::input_range R2>
 osc::and { r1.insert(it, first, last)