Pigweed
 
Loading...
Searching...
No Matches
pw::containers Namespace Reference

Classes

class  FilteredView
 

Functions

template<typename C , typename Pred >
bool AllOf (const C &c, Pred &&pred)
 
template<typename C , typename Pred >
bool AnyOf (const C &c, Pred &&pred)
 
template<typename C , typename Pred >
bool NoneOf (const C &c, Pred &&pred)
 
template<typename C , typename Function >
std::decay_t< FunctionForEach (C &&c, Function &&f)
 
template<typename C , typename T >
internal_algorithm::ContainerIter< C > Find (C &c, T &&value)
 
template<typename C , typename Pred >
internal_algorithm::ContainerIter< C > FindIf (C &c, Pred &&pred)
 
template<typename C , typename Pred >
internal_algorithm::ContainerIter< C > FindIfNot (C &c, Pred &&pred)
 
template<typename Sequence1 , typename Sequence2 >
internal_algorithm::ContainerIter< Sequence1 > FindEnd (Sequence1 &sequence, Sequence2 &subsequence)
 
template<typename Sequence1 , typename Sequence2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence1 > FindEnd (Sequence1 &sequence, Sequence2 &subsequence, BinaryPredicate &&pred)
 
template<typename C1 , typename C2 >
internal_algorithm::ContainerIter< C1 > FindFirstOf (C1 &container, C2 &options)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< C1 > FindFirstOf (C1 &container, C2 &options, BinaryPredicate &&pred)
 
template<typename Sequence >
internal_algorithm::ContainerIter< Sequence > AdjacentFind (Sequence &sequence)
 
template<typename Sequence , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence > AdjacentFind (Sequence &sequence, BinaryPredicate &&pred)
 
template<typename C , typename T >
internal_algorithm::ContainerDifferenceType< const C > Count (const C &c, T &&value)
 
template<typename C , typename Pred >
internal_algorithm::ContainerDifferenceType< const C > CountIf (const C &c, Pred &&pred)
 
template<typename C1 , typename C2 >
internal_algorithm::ContainerIterPairType< C1, C2 > Mismatch (C1 &c1, C2 &c2)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
internal_algorithm::ContainerIterPairType< C1, C2 > Mismatch (C1 &c1, C2 &c2, BinaryPredicate pred)
 
template<typename C1 , typename C2 >
bool Equal (const C1 &c1, const C2 &c2)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
bool Equal (const C1 &c1, const C2 &c2, BinaryPredicate &&pred)
 
template<typename C1 , typename C2 >
bool IsPermutation (const C1 &c1, const C2 &c2)
 
template<typename C1 , typename C2 , typename BinaryPredicate >
bool IsPermutation (const C1 &c1, const C2 &c2, BinaryPredicate &&pred)
 
template<typename Sequence1 , typename Sequence2 >
internal_algorithm::ContainerIter< Sequence1 > Search (Sequence1 &sequence, Sequence2 &subsequence)
 
template<typename Sequence1 , typename Sequence2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence1 > Search (Sequence1 &sequence, Sequence2 &subsequence, BinaryPredicate &&pred)
 
template<typename Sequence , typename Size , typename T >
internal_algorithm::ContainerIter< Sequence > SearchN (Sequence &sequence, Size count, T &&value)
 
template<typename Sequence , typename Size , typename T , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence > SearchN (Sequence &sequence, Size count, T &&value, BinaryPredicate &&pred)
 

Detailed Description

have no equivalent here.

For template parameter and variable naming, C indicates the container type to which the function is applied, Pred indicates the predicate object type to be used by the function and T indicates the applicable element type.

Function Documentation

◆ AdjacentFind() [1/2]

template<typename Sequence >
internal_algorithm::ContainerIter< Sequence > pw::containers::AdjacentFind ( Sequence &  sequence)

Container-based version of the <algorithm> std::adjacent_find() function to find equal adjacent elements within a container.

◆ AdjacentFind() [2/2]

template<typename Sequence , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence > pw::containers::AdjacentFind ( Sequence &  sequence,
BinaryPredicate &&  pred 
)

Overload of AdjacentFind() for using a predicate evaluation other than == as the function's test condition.

◆ AllOf()

template<typename C , typename Pred >
bool pw::containers::AllOf ( const C &  c,
Pred &&  pred 
)

Container-based version of the <algorithm> std::all_of() function to test if all elements within a container satisfy a condition.

◆ AnyOf()

template<typename C , typename Pred >
bool pw::containers::AnyOf ( const C &  c,
Pred &&  pred 
)

Container-based version of the <algorithm> std::any_of() function to test if any element in a container fulfills a condition.

◆ Count()

template<typename C , typename T >
internal_algorithm::ContainerDifferenceType< const C > pw::containers::Count ( const C &  c,
T &&  value 
)

Container-based version of the <algorithm> std::count() function to count values that match within a container.

◆ CountIf()

template<typename C , typename Pred >
internal_algorithm::ContainerDifferenceType< const C > pw::containers::CountIf ( const C &  c,
Pred &&  pred 
)

Container-based version of the <algorithm> std::count_if() function to count values matching a condition within a container.

◆ Equal() [1/2]

template<typename C1 , typename C2 >
bool pw::containers::Equal ( const C1 &  c1,
const C2 &  c2 
)

Container-based version of the <algorithm> std::equal() function to test whether two containers are equal.

Note
The semantics of Equal() are slightly different than those of std::equal(). While the latter iterates over the second container only up to the size of the first container, Equal() also checks whether the container sizes are equal. This better matches expectations about Equal() based on its signature.
vector v1 = <1, 2, 3>;
vector v2 = <1, 2, 3, 4>;
EXPECT_TRUE(equal(std::begin(v1), std::end(v1), std::begin(v2)));
EXPECT_FALSE(Equal(v1, v2));
bool Equal(const C1 &c1, const C2 &c2)
Definition: algorithm.h:236

◆ Equal() [2/2]

template<typename C1 , typename C2 , typename BinaryPredicate >
bool pw::containers::Equal ( const C1 &  c1,
const C2 &  c2,
BinaryPredicate &&  pred 
)

Overload of Equal() for using a predicate evaluation other than == as the function's test condition.

◆ Find()

template<typename C , typename T >
internal_algorithm::ContainerIter< C > pw::containers::Find ( C &  c,
T &&  value 
)

Container-based version of the <algorithm> std::find() function to find the first element containing the passed value within a container value.

◆ FindEnd() [1/2]

template<typename Sequence1 , typename Sequence2 >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::FindEnd ( Sequence1 &  sequence,
Sequence2 &  subsequence 
)

Container-based version of the <algorithm> std::find_end() function to find the last subsequence within a container.

◆ FindEnd() [2/2]

template<typename Sequence1 , typename Sequence2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::FindEnd ( Sequence1 &  sequence,
Sequence2 &  subsequence,
BinaryPredicate &&  pred 
)

Overload of FindEnd() for using a predicate evaluation other than == as the function's test condition.

◆ FindFirstOf() [1/2]

template<typename C1 , typename C2 >
internal_algorithm::ContainerIter< C1 > pw::containers::FindFirstOf ( C1 &  container,
C2 &  options 
)

Container-based version of the <algorithm> std::find_first_of() function to find the first element within the container that is also within the options container.

◆ FindFirstOf() [2/2]

template<typename C1 , typename C2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< C1 > pw::containers::FindFirstOf ( C1 &  container,
C2 &  options,
BinaryPredicate &&  pred 
)

Overload of FindFirstOf() for using a predicate evaluation other than == as the function's test condition.

◆ FindIf()

template<typename C , typename Pred >
internal_algorithm::ContainerIter< C > pw::containers::FindIf ( C &  c,
Pred &&  pred 
)

Container-based version of the <algorithm> std::find_if() function to find the first element in a container matching the given condition.

◆ FindIfNot()

template<typename C , typename Pred >
internal_algorithm::ContainerIter< C > pw::containers::FindIfNot ( C &  c,
Pred &&  pred 
)

Container-based version of the <algorithm> std::find_if_not() function to find the first element in a container not matching the given condition.

◆ ForEach()

template<typename C , typename Function >
std::decay_t< Function > pw::containers::ForEach ( C &&  c,
Function &&  f 
)

Container-based version of the <algorithm> std::for_each() function to apply a function to a container's elements.

◆ IsPermutation() [1/2]

template<typename C1 , typename C2 >
bool pw::containers::IsPermutation ( const C1 &  c1,
const C2 &  c2 
)

Container-based version of the <algorithm> std::is_permutation() function to test whether a container is a permutation of another.`

◆ IsPermutation() [2/2]

template<typename C1 , typename C2 , typename BinaryPredicate >
bool pw::containers::IsPermutation ( const C1 &  c1,
const C2 &  c2,
BinaryPredicate &&  pred 
)

Overload of IsPermutation() for using a predicate evaluation other than == as the function's test condition.

◆ Mismatch() [1/2]

template<typename C1 , typename C2 >
internal_algorithm::ContainerIterPairType< C1, C2 > pw::containers::Mismatch ( C1 &  c1,
C2 &  c2 
)

Container-based version of the <algorithm> std::mismatch() function to return the first element where two ordered containers differ. Applies == to the first N elements of c1 and c2, where N = min(size(c1), size(c2)).

◆ Mismatch() [2/2]

template<typename C1 , typename C2 , typename BinaryPredicate >
internal_algorithm::ContainerIterPairType< C1, C2 > pw::containers::Mismatch ( C1 &  c1,
C2 &  c2,
BinaryPredicate  pred 
)

Overload of Mismatch() for using a predicate evaluation other than == as the function's test condition. Applies predto the first N elements of c1 and c2, where N = min(size(c1), size(c2)).

◆ NoneOf()

template<typename C , typename Pred >
bool pw::containers::NoneOf ( const C &  c,
Pred &&  pred 
)

Container-based version of the <algorithm> std::none_of() function to test if no elements in a container fulfill a condition.

◆ Search() [1/2]

template<typename Sequence1 , typename Sequence2 >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::Search ( Sequence1 &  sequence,
Sequence2 &  subsequence 
)

Container-based version of the <algorithm> std::search() function to search a container for a subsequence.

◆ Search() [2/2]

template<typename Sequence1 , typename Sequence2 , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence1 > pw::containers::Search ( Sequence1 &  sequence,
Sequence2 &  subsequence,
BinaryPredicate &&  pred 
)

Overload of Search() for using a predicate evaluation other than == as the function's test condition.

◆ SearchN() [1/2]

template<typename Sequence , typename Size , typename T >
internal_algorithm::ContainerIter< Sequence > pw::containers::SearchN ( Sequence &  sequence,
Size  count,
T &&  value 
)

Container-based version of the <algorithm> std::search_n() function to search a container for the first sequence of N elements.

◆ SearchN() [2/2]

template<typename Sequence , typename Size , typename T , typename BinaryPredicate >
internal_algorithm::ContainerIter< Sequence > pw::containers::SearchN ( Sequence &  sequence,
Size  count,
T &&  value,
BinaryPredicate &&  pred 
)

Overload of SearchN() for using a predicate evaluation other than == as the function's test condition.