VCCC  2024.05
VisualCamp Common C++ library
algorithm

Detailed Description

Classes

struct  in_found_result< I >
 
struct  in_fun_result< I, F >
 
struct  in_in_out_result< I1, I2, O >
 
struct  in_in_result< I1, I2 >
 
struct  in_out_out_result< I, O1, O2 >
 
struct  in_out_result< I, O >
 
struct  in_value_result< I, T >
 
struct  min_max_result< T >
 
struct  out_value_result< I, T >
 

Typedefs

template<typename I , typename F >
using for_each_result = in_fun_result< I, F >
 
template<typename I , typename F >
using for_each_n_result = in_fun_result< I, F >
 
template<typename I1 , typename I2 >
using mismatch_result = in_in_result< I1, I2 >
 
template<class I1 , class I2 >
using swap_ranges_result = in_in_result< I1, I2 >
 

Functions

template<typename T , typename Compare >
constexpr const T & clamp (const T &v, const T &lo, const T &hi, Compare comp)
 
template<typename T >
constexpr const T & clamp (const T &v, const T &lo, const T &hi)
 
template<typename InputIt , typename Size , typename UnaryFunction >
constexpr InputIt for_each_n (InputIt first, Size n, UnaryFunction f)
 
template<typename ForwardIt >
constexpr ForwardIt shift_left (ForwardIt first, ForwardIt last, typename cxx20_iterator_traits< ForwardIt >::difference_type n)
 
template<typename ForwardIt >
constexpr ForwardIt shift_right (ForwardIt first, ForwardIt last, typename cxx20_iterator_traits< ForwardIt >::difference_type n)
 

Variables

constexpr VCCC_INLINE_OR_STATIC detail::all_of_niebloid all_of {}
 
constexpr VCCC_INLINE_OR_STATIC detail::any_of_niebloid any_of {}
 
constexpr VCCC_INLINE_OR_STATIC detail::clamp_niebloid clamp {}
 clamps a value between a pair of boundary values More...
 
constexpr VCCC_INLINE_OR_STATIC detail::contains_niebloid contains {}
 
constexpr VCCC_INLINE_OR_STATIC detail::contains_subrange_niebloid contains_subrange {}
 
constexpr VCCC_INLINE_OR_STATIC detail::copy_niebloid copy {}
 
constexpr VCCC_INLINE_OR_STATIC detail::count_niebloid count {}
 
constexpr VCCC_INLINE_OR_STATIC detail::count_if_niebloid count_if {}
 
constexpr VCCC_INLINE_OR_STATIC detail::equal_niebloid equal {}
 Two ranges are considered equal if they have the same number of elements and every pair of corresponding projected elements satisfies pred More...
 
constexpr VCCC_INLINE_OR_STATIC detail::find_niebloid find {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_end_niebloid find_end {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_first_of_niebloid find_first_of {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_if_niebloid find_if {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_if_not_niebloid find_if_not {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_last_niebloid find_last {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_last_if_niebloid find_last_if {}
 
constexpr VCCC_INLINE_OR_STATIC detail::find_last_if_not_niebloid find_last_if_not {}
 
constexpr VCCC_INLINE_OR_STATIC detail::fold_left_niebloid fold_left {}
 
constexpr VCCC_INLINE_OR_STATIC detail::for_each_niebloid for_each {}
 
constexpr VCCC_INLINE_OR_STATIC detail::for_each_n_niebloid for_each_n {}
 
constexpr VCCC_INLINE_OR_STATIC detail::lexicographical_compare_niebloid lexicographical_compare {}
 returns true if one range is lexicographically less than another More...
 
constexpr VCCC_INLINE_OR_STATIC detail::make_heap_niebloid make_heap {}
 
constexpr VCCC_INLINE_OR_STATIC detail::max_niebloid max {}
 
constexpr VCCC_INLINE_OR_STATIC detail::max_element_niebloid max_element {}
 
constexpr VCCC_INLINE_OR_STATIC detail::min_niebloid min {}
 
constexpr VCCC_INLINE_OR_STATIC detail::min_element_niebloid min_element {}
 
constexpr VCCC_INLINE_OR_STATIC detail::mismatch_niebloid mismatch {}
 
constexpr VCCC_INLINE_OR_STATIC detail::none_of_niebloid none_of {}
 
constexpr VCCC_INLINE_OR_STATIC detail::pop_heap_niebloid pop_heap {}
 
constexpr VCCC_INLINE_OR_STATIC detail::search_niebloid search {}
 
constexpr VCCC_INLINE_OR_STATIC detail::sort_niebloid sort {}
 
constexpr VCCC_INLINE_OR_STATIC detail::sort_heap_niebloid sort_heap {}
 
constexpr VCCC_INLINE_OR_STATIC detail::swap_ranges_niebloid swap_ranges {}
 

Typedef Documentation

◆ for_each_n_result

◆ for_each_result

◆ mismatch_result

using mismatch_result = in_in_result<I1, I2>

◆ swap_ranges_result

Function Documentation

◆ clamp() [1/2]

constexpr const T& vccc::clamp ( const T &  v,
const T &  lo,
const T &  hi 
)
constexpr

◆ clamp() [2/2]

constexpr const T& vccc::clamp ( const T &  v,
const T &  lo,
const T &  hi,
Compare  comp 
)
constexpr

◆ for_each_n()

constexpr InputIt vccc::for_each_n ( InputIt  first,
Size  n,
UnaryFunction  f 
)
constexpr

◆ shift_left()

constexpr ForwardIt vccc::shift_left ( ForwardIt  first,
ForwardIt  last,
typename cxx20_iterator_traits< ForwardIt >::difference_type  n 
)
constexpr

◆ shift_right()

constexpr ForwardIt vccc::shift_right ( ForwardIt  first,
ForwardIt  last,
typename cxx20_iterator_traits< ForwardIt >::difference_type  n 
)
constexpr

Variable Documentation

◆ all_of

constexpr VCCC_INLINE_OR_STATIC detail::all_of_niebloid all_of {}
constexpr

◆ any_of

constexpr VCCC_INLINE_OR_STATIC detail::any_of_niebloid any_of {}
constexpr

◆ clamp

constexpr VCCC_INLINE_OR_STATIC detail::clamp_niebloid clamp {}
constexpr

If v compares less than lo, returns lo; otherwise if hi compares less than v, returns hi; otherwise returns v.

The behavior is undefined if lo is greater than hi.

Complexity

At most two comparisons and three applications of the projection.

See also
std::ranges::clamp
std::clamp
vccc::clamp

◆ contains

constexpr VCCC_INLINE_OR_STATIC detail::contains_niebloid contains {}
constexpr

◆ contains_subrange

constexpr VCCC_INLINE_OR_STATIC detail::contains_subrange_niebloid contains_subrange {}
constexpr

◆ copy

constexpr VCCC_INLINE_OR_STATIC detail::copy_niebloid copy {}
constexpr

◆ count

constexpr VCCC_INLINE_OR_STATIC detail::count_niebloid count {}
constexpr

◆ count_if

constexpr VCCC_INLINE_OR_STATIC detail::count_if_niebloid count_if {}
constexpr

◆ equal

constexpr VCCC_INLINE_OR_STATIC detail::equal_niebloid equal {}
constexpr

◆ find

constexpr VCCC_INLINE_OR_STATIC detail::find_niebloid find {}
constexpr

◆ find_end

constexpr VCCC_INLINE_OR_STATIC detail::find_end_niebloid find_end {}
constexpr

◆ find_first_of

constexpr VCCC_INLINE_OR_STATIC detail::find_first_of_niebloid find_first_of {}
constexpr

◆ find_if

constexpr VCCC_INLINE_OR_STATIC detail::find_if_niebloid find_if {}
constexpr

◆ find_if_not

constexpr VCCC_INLINE_OR_STATIC detail::find_if_not_niebloid find_if_not {}
constexpr

◆ find_last

constexpr VCCC_INLINE_OR_STATIC detail::find_last_niebloid find_last {}
constexpr

◆ find_last_if

constexpr VCCC_INLINE_OR_STATIC detail::find_last_if_niebloid find_last_if {}
constexpr

◆ find_last_if_not

constexpr VCCC_INLINE_OR_STATIC detail::find_last_if_not_niebloid find_last_if_not {}
constexpr

◆ fold_left

constexpr VCCC_INLINE_OR_STATIC detail::fold_left_niebloid fold_left {}
constexpr

◆ for_each

constexpr VCCC_INLINE_OR_STATIC detail::for_each_niebloid for_each {}
constexpr

◆ for_each_n

constexpr VCCC_INLINE_OR_STATIC detail::for_each_n_niebloid for_each_n {}
constexpr

◆ lexicographical_compare

constexpr VCCC_INLINE_OR_STATIC detail::lexicographical_compare_niebloid lexicographical_compare {}
constexpr

◆ make_heap

constexpr VCCC_INLINE_OR_STATIC detail::make_heap_niebloid make_heap {}
constexpr

◆ max

constexpr VCCC_INLINE_OR_STATIC detail::max_niebloid max {}
constexpr

◆ max_element

constexpr VCCC_INLINE_OR_STATIC detail::max_element_niebloid max_element {}
constexpr

◆ min

constexpr VCCC_INLINE_OR_STATIC detail::min_niebloid min {}
constexpr

◆ min_element

constexpr VCCC_INLINE_OR_STATIC detail::min_element_niebloid min_element {}
constexpr

◆ mismatch

constexpr VCCC_INLINE_OR_STATIC detail::mismatch_niebloid mismatch {}
constexpr

◆ none_of

constexpr VCCC_INLINE_OR_STATIC detail::none_of_niebloid none_of {}
constexpr

◆ pop_heap

constexpr VCCC_INLINE_OR_STATIC detail::pop_heap_niebloid pop_heap {}
constexpr

◆ search

constexpr VCCC_INLINE_OR_STATIC detail::search_niebloid search {}
constexpr

◆ sort

constexpr VCCC_INLINE_OR_STATIC detail::sort_niebloid sort {}
constexpr

◆ sort_heap

constexpr VCCC_INLINE_OR_STATIC detail::sort_heap_niebloid sort_heap {}
constexpr

◆ swap_ranges

constexpr VCCC_INLINE_OR_STATIC detail::swap_ranges_niebloid swap_ranges {}
constexpr