OSSIA
Open Scenario System for Interactive Application
algorithms.hpp File Reference

Detailed Description

This header contains various range-style functions that mimic std::algorithm functions. This won't be necessary anymore when ranges are introduced in C++20 (hopefully).

Go to the source code of this file.

Namespaces

 ossia
 
 ossia::detail
 

Typedefs

template<typename Vector >
using ossia::iterator_t = typename std::remove_reference< Vector >::type::iterator
 

Functions

template<typename Vector , typename Value >
auto ossia::find (Vector &&v, const Value &val) noexcept
 
template<typename Vector , typename Fun >
auto ossia::find_if (Vector &&v, Fun fun)
 
template<typename Vector , typename Value >
auto * ossia::ptr_find (Vector &&v, const Value &val) noexcept
 
template<typename Vector , typename Fun >
auto * ossia::ptr_find_if (Vector &&v, Fun fun)
 
template<typename Vector , typename Value >
bool ossia::contains (Vector &&v, const Value &val) noexcept
 
template<typename Vector , typename Value >
void ossia::remove_one (Vector &&v, const Value &val)
 
template<typename Vector , typename Function >
void ossia::remove_one_if (Vector &v, const Function &val)
 
template<typename Vector , typename Value >
void ossia::remove_erase (Vector &v, const Value &val)
 
template<typename Vector , typename Function >
void ossia::remove_erase_if (Vector &v, const Function &val)
 
template<typename Vector , typename Fun >
void ossia::erase_if (Vector &r, Fun f)
 
template<typename Vector , typename Fun >
bool ossia::any_of (Vector &&v, Fun fun) noexcept
 
template<typename Vector , typename Fun >
auto ossia::all_of (Vector &&v, Fun fun) noexcept
 
template<typename Vector , typename Fun >
bool ossia::none_of (Vector &&v, Fun fun) noexcept
 
template<typename Vector , typename Fun >
auto ossia::remove_if (Vector &&v, Fun fun)
 
template<typename Vector , typename Fun >
auto ossia::count_if (Vector &&v, Fun fun)
 
template<typename Vector , typename Fun >
auto ossia::max_element (Vector &&v, Fun fun)
 
template<typename Vector >
auto ossia::sort (Vector &&v)
 
template<typename Vector , typename T >
auto ossia::fill (Vector &&v, const T &val)
 
template<typename Vector >
auto ossia::unique (Vector &&v)
 
template<typename Vector , typename Fun >
auto ossia::sort (Vector &&v, Fun fun)
 
template<typename Vector , typename OutputIterator , typename Fun >
auto ossia::transform (Vector &&v, OutputIterator it, Fun f)
 
template<typename Array1 , typename Array2 >
auto ossia::equal (const Array1 &v, const Array2 &v2) noexcept
 
template<typename Vector1 , typename Vector2 >
void ossia::copy (const Vector1 &source, Vector2 &destination)
 
template<typename Vector1 , typename Vector2 , typename Pred >
void ossia::copy_if (const Vector1 &source, Vector2 &destination, Pred predicate)
 
template<typename T , typename K >
auto ossia::last_before (T &&container, const K &k)
 
template<typename T , typename K >
auto ossia::find_key (T &&vec, const K &key) noexcept
 
template<class F , std::size_t... Is>
void ossia::for_each_in_range (F &&func, std::index_sequence< Is... >)
 
template<std::size_t N, typename F >
void ossia::for_each_in_range (F &&func)
 
template<class T , std::size_t N, std::size_t... I>
constexpr std::array< std::remove_cv_t< T >, N > ossia::detail::to_array_impl (T(&a)[N], std::index_sequence< I... >) noexcept
 
template<class T , std::size_t N>
constexpr std::array< std::remove_cv_t< T >, N > ossia::to_array (T(&a)[N]) noexcept
 
template<typename... Args>
constexpr std::array< const char *, sizeof...(Args)> ossia::make_array (Args &&... args) noexcept
 
template<typename T >
void ossia::remove_duplicates (T &vec)
 
template<typename T , typename Comp >
void ossia::remove_duplicates (T &vec, Comp comparator)
 
template<typename Container , typename K , typename Comp , typename... Args>
auto ossia::emplace_sorted (Container &vec, const K &k, Comp &&comp, Args &&... args) -> decltype(auto)
 
template<typename D , template< typename, typename > typename S, typename T , typename Alloc >
auto ossia::insert_at_end (D &dest, S< T, Alloc > &&src)
 
template<typename T >
void ossia::change_item_position (T &v, size_t oldIndex, size_t newIndex)
 
template<typename Container , typename Item >
int ossia::index_in_container (Container &vec, Item i) noexcept