C/C++ API Reference
Loading...
Searching...
No Matches
algorithm.h File Reference
#include <algorithm>
#include <utility>
#include "pw_containers/internal/algorithm_internal.h"

Go to the source code of this file.

Namespaces

namespace  pw
 The Pigweed namespace.
 

Functions

template<typename C , typename Pred >
bool pw::containers::AllOf (const C &c, Pred &&pred)
 
template<typename C , typename Pred >
bool pw::containers::AnyOf (const C &c, Pred &&pred)
 
template<typename C , typename Pred >
bool pw::containers::NoneOf (const C &c, Pred &&pred)
 
template<typename C , typename Function >
std::decay_t< Function > pw::containers::ForEach (C &&c, Function &&f)
 
template<typename C , typename T >
internal_algorithm::ContainerIter< C > pw::containers::Find (C &c, T &&value)
 
template<typename C , typename Pred >
internal_algorithm::ContainerIter< C > pw::containers::FindIf (C &c, Pred &&pred)
 
template<typename C , typename Pred >
internal_algorithm::ContainerIter< C > pw::containers::FindIfNot (C &c, Pred &&pred)
 
template<typename Sequence1 , typename Sequence2 >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::FindEnd (Sequence1 &sequence, Sequence2 &subsequence)
 
template<typename Sequence1 , typename Sequence2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::FindEnd (Sequence1 &sequence, Sequence2 &subsequence, BinaryPredicate &&pred)
 
template<typename C1 , typename C2 >
internal_algorithm::ContainerIter< C1 > pw::containers::FindFirstOf (C1 &container, C2 &options)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< C1 > pw::containers::FindFirstOf (C1 &container, C2 &options, BinaryPredicate &&pred)
 
template<typename Sequence >
internal_algorithm::ContainerIter< Sequence > pw::containers::AdjacentFind (Sequence &sequence)
 
template<typename Sequence , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence > pw::containers::AdjacentFind (Sequence &sequence, BinaryPredicate &&pred)
 
template<typename C , typename T >
internal_algorithm::ContainerDifferenceType< const C > pw::containers::Count (const C &c, T &&value)
 
template<typename C , typename Pred >
internal_algorithm::ContainerDifferenceType< const C > pw::containers::CountIf (const C &c, Pred &&pred)
 
template<typename C1 , typename C2 >
internal_algorithm::ContainerIterPairType< C1, C2 > pw::containers::Mismatch (C1 &c1, C2 &c2)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
internal_algorithm::ContainerIterPairType< C1, C2 > pw::containers::Mismatch (C1 &c1, C2 &c2, BinaryPredicate pred)
 
template<typename C1 , typename C2 >
bool pw::containers::Equal (const C1 &c1, const C2 &c2)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
bool pw::containers::Equal (const C1 &c1, const C2 &c2, BinaryPredicate &&pred)
 
template<typename C1 , typename C2 >
bool pw::containers::IsPermutation (const C1 &c1, const C2 &c2)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
bool pw::containers::IsPermutation (const C1 &c1, const C2 &c2, BinaryPredicate &&pred)
 
template<typename Sequence1 , typename Sequence2 >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::Search (Sequence1 &sequence, Sequence2 &subsequence)
 
template<typename Sequence1 , typename Sequence2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::Search (Sequence1 &sequence, Sequence2 &subsequence, BinaryPredicate &&pred)
 
template<typename Sequence , typename Size , typename T >
internal_algorithm::ContainerIter< Sequence > pw::containers::SearchN (Sequence &sequence, Size count, T &&value)
 
template<typename Sequence , typename Size , typename T , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence > pw::containers::SearchN (Sequence &sequence, Size count, T &&value, BinaryPredicate &&pred)
 
template<typename InputIt , typename Predicate >
constexpr bool pw::all_of (InputIt first, InputIt last, Predicate pred)
 constexpr backport of <algorithm>'s std::all_of for C++17.
 
template<typename InputIt , typename Predicate >
constexpr bool pw::any_of (InputIt first, InputIt last, Predicate pred)
 constexpr backport of <algorithm>'s std::any_of for C++17.
 
template<typename InputIt , typename Predicate >
constexpr InputIt pw::find_if (InputIt first, InputIt last, Predicate pred)
 constexpr backport of <algorithm>'s std::find_if for C++17.
 
template<typename ForwardIt , typename T >
constexpr void pw::fill (ForwardIt begin, ForwardIt end, const T &value)
 constexpr backport of <algorithm>'s std::fill for C++17.
 
template<typename It , typename Size , typename T >
constexpr It pw::fill_n (It begin, Size count, const T &value)
 constexpr backport of <algorithm>'s std::fill_n for C++17.
 

Detailed Description

This header file provides container-based versions of algorithmic functions within the C++ standard library, based on pw_containers. The following standard library sets of functions are covered within this file:

  • <algorithm> functions

The standard library functions operate on iterator ranges; the functions within this API operate on containers, though many return iterator ranges.

All functions within this API are CamelCase instead of their std:: snake_case counterparts. Calls such as pw::containers::Foo(container, ...) are equivalent to std:: functions such as std::foo(std::begin(cont), std::end(cont), ...). Functions that act on iterators but not conceptually on iterator ranges (e.g. std::iter_swap)