qxLib
Functions
equal.h File Reference
#include <qx/algo/equal.inl>

Go to the source code of this file.

Functions

template<class it_1_t , class it_2_t , class pred_t >
bool qx::equal_rotated (it_1_t range1Begin, it_1_t range1End, it_2_t range2Begin, it_2_t range2End, const pred_t &pred) noexcept
 Check if two ranges contains same values in a certain order, which may be shifted. More...
 
template<class range_1_t , class range_2_t , class pred_t >
bool qx::equal_rotated (const range_1_t &range1, const range_2_t &range2, const pred_t &pred) noexcept
 Check if two ranges contains same values in a certain order, which may be shifted. More...
 
template<class it_1_t , class it_2_t >
bool qx::equal_rotated (it_1_t range1Begin, it_1_t range1End, it_2_t range2Begin, it_2_t range2End) noexcept
 Check if two ranges contains same values in a certain order, which may be shifted. More...
 
template<class range_1_t , class range_2_t >
bool qx::equal_rotated (const range_1_t &range1, const range_2_t &range2) noexcept
 Check if two ranges contains same values in a certain order, which may be shifted. More...
 

Detailed Description

Author
Khrapov
Date
20.08.2023

Definition in file equal.h.

Function Documentation

◆ equal_rotated() [1/4]

template<class range_1_t , class range_2_t >
bool qx::equal_rotated ( const range_1_t &  range1,
const range_2_t &  range2 
)
inlinenoexcept

Check if two ranges contains same values in a certain order, which may be shifted.

For { 0, 1, 2 } returns true for { 1, 2, 0 }, but false for { 1, 2 } and { 2, 1, 0 }

Template Parameters
range_1_t- first range type
range_2_t- second range type
Parameters
range1- first range
range2- second range
Return values
-true if ranges are equal

Definition at line 69 of file equal.inl.

◆ equal_rotated() [2/4]

template<class range_1_t , class range_2_t , class pred_t >
bool qx::equal_rotated ( const range_1_t &  range1,
const range_2_t &  range2,
const pred_t &  pred 
)
inlinenoexcept

Check if two ranges contains same values in a certain order, which may be shifted.

For { 0, 1, 2 } returns true for { 1, 2, 0 }, but false for { 1, 2 } and { 2, 1, 0 }

Template Parameters
range_1_t- first range type
range_2_t- second range type
pred_t- predicate type
Parameters
range1- first range
range2- second range
pred- predicate that compares values from left and right ranges
Return values
-true if ranges are equal

Definition at line 49 of file equal.inl.

◆ equal_rotated() [3/4]

template<class it_1_t , class it_2_t >
bool qx::equal_rotated ( it_1_t  range1Begin,
it_1_t  range1End,
it_2_t  range2Begin,
it_2_t  range2End 
)
inlinenoexcept

Check if two ranges contains same values in a certain order, which may be shifted.

For { 0, 1, 2 } returns true for { 1, 2, 0 }, but false for { 1, 2 } and { 2, 1, 0 }

Template Parameters
it_1_t- first range iterator type
it_2_t- second range iterator type
Parameters
range1Begin- first range begin iterator
range1End- first range end iterator
range2Begin- second range begin iterator
range2End- second range end iterator
Return values
-true if ranges are equal

Definition at line 55 of file equal.inl.

◆ equal_rotated() [4/4]

template<class it_1_t , class it_2_t , class pred_t >
bool qx::equal_rotated ( it_1_t  range1Begin,
it_1_t  range1End,
it_2_t  range2Begin,
it_2_t  range2End,
const pred_t &  pred 
)
inlinenoexcept

Check if two ranges contains same values in a certain order, which may be shifted.

For { 0, 1, 2 } returns true for { 1, 2, 0 }, but false for { 1, 2 } and { 2, 1, 0 }

Template Parameters
it_1_t- first range iterator type
it_2_t- second range iterator type
pred_t- predicate type
Parameters
range1Begin- first range begin iterator
range1End- first range end iterator
range2Begin- second range begin iterator
range2End- second range end iterator
pred- predicate that compares values from left and right ranges
Return values
-true if ranges are equal

Definition at line 14 of file equal.inl.