qxLib
Functions
all_of_equal.h File Reference
#include <algorithm>

Go to the source code of this file.

Functions

template<class fwd_it_t , class predicate_t >
bool qx::all_of_equal (fwd_it_t itBegin, fwd_it_t itEnd, const predicate_t &predicate)
 Returns true if the predicate yields the same value for all elements in the range [itBegin, itEnd). More...
 
template<class container_t , class predicate_t >
bool qx::all_of_equal (const container_t &container, const predicate_t &predicate)
 Returns true if the predicate yields the same value for all elements in the range [itBegin, itEnd). More...
 

Detailed Description

Author
Khrapov
Date
7.02.2026

Definition in file all_of_equal.h.

Function Documentation

◆ all_of_equal() [1/2]

template<class container_t , class predicate_t >
bool qx::all_of_equal ( const container_t &  container,
const predicate_t &  predicate 
)

Returns true if the predicate yields the same value for all elements in the range [itBegin, itEnd).

This implements a logical biconditional (logical equivalence) over the range: predicate(x1) <-> predicate(x2) <-> ... <-> predicate(xn)

Template Parameters
container_t- container type
predicate_t- predicate type
Parameters
container- input range
predicate- predicate to check
Return values
-true if the predicate yields the same value for all elements in the range, otherwise false

Definition at line 54 of file all_of_equal.h.

◆ all_of_equal() [2/2]

template<class fwd_it_t , class predicate_t >
bool qx::all_of_equal ( fwd_it_t  itBegin,
fwd_it_t  itEnd,
const predicate_t &  predicate 
)

Returns true if the predicate yields the same value for all elements in the range [itBegin, itEnd).

This implements a logical biconditional (logical equivalence) over the range: predicate(x1) <-> predicate(x2) <-> ... <-> predicate(xn)

Template Parameters
fwd_it_t- forward iterator type
predicate_t- predicate type
Parameters
itBegin- range begin iterator
itEnd- range end iterator
predicate- predicate to check
Return values
-true if the predicate yields the same value for all elements in the range, otherwise false

Definition at line 28 of file all_of_equal.h.