|
template<typename Callable > |
constexpr auto | repeat (std::size_t N, Callable func) noexcept(noexcept(func())) -> return_assert_t< is_invocable< Callable >::value, void > |
| Invoke a function N times. More...
|
|
template<typename Container , typename Elem > |
constexpr auto | erase (Container &c, const Elem &val) noexcept(noexcept(c.erase(std::remove(c.begin(), c.end(), val), c.end()))) -> void |
| Abbreviation of the erase-remove idiom as a free function. More...
|
|
template<typename Container , typename UnaryPredicate > |
constexpr auto | erase_if (Container &c, UnaryPredicate p) noexcept(noexcept(c.erase(std::remove_if(c.begin(), c.end(), std::ref(p)), c.end()))) -> void |
| Abbreviation of the erase-remove idiom as a free function. More...
|
|
template<typename Obj > |
constexpr auto | equals (const Obj &a, const Obj &b) noexcept(noexcept(a< b)) -> bool |
| Synthesize an equivalence relation from <. More...
|
|
template<typename Obj , typename Compare > |
constexpr auto | equals (const Obj &a, const Obj &b, Compare comp) noexcept(noexcept(comp(a, b))) -> bool |
| Synthesize an equivalence relation from comp. More...
|
|
template<typename InputIt , typename T > |
constexpr auto | accumulate (InputIt first, InputIt last, T init) -> T |
| A constexpr version of std::accumulate. More...
|
|
template<class InputIt , class T , class BinaryOperation > |
constexpr auto | accumulate (InputIt first, InputIt last, T init, BinaryOperation op) -> T |
| A constexpr version of std::accumulate. More...
|
|
template<typename InputIt > |
constexpr auto | sum (InputIt first, InputIt last) -> std::decay_t< decltype(*first)> |
| Sum a range. More...
|
|
template<typename InputIt , typename BinaryOperation > |
constexpr auto | sum (InputIt first, InputIt last, BinaryOperation op) -> std::decay_t< decltype(*first)> |
| Fold a range over an operation. More...
|
|
template<typename Range > |
constexpr auto | sum (Range &&r) -> auto |
| Sum a range. More...
|
|
template<typename InputIt , typename EndIt , typename OutputIt , typename T , typename BinaryAccumulation , typename UnaryTransform > |
constexpr auto | transform_exclusive_scan (InputIt first, EndIt last, OutputIt d_first, T init, BinaryAccumulation accum, UnaryTransform proj) -> OutputIt |
|
template<typename ForwardIt , typename EndIt , typename Elem > |
constexpr auto | find (ForwardIt begin, EndIt end, const Elem &value) noexcept(noexcept(*begin==value)) -> ForwardIt |
| Finds a value in range [begin, end). If not found, returns end. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename Elem , typename Comp > |
constexpr auto | find (ForwardIt begin, EndIt end, const Elem &value, Comp &&comp) noexcept(noexcept(comp(*begin, value))) -> ForwardIt |
| Finds a value in range [begin, end). If not found, returns end. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_if (ForwardIt begin, EndIt end, UnaryPredicate &&pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> ForwardIt |
| Finds the first value in range [begin, end) for which pred returns true. If not found, returns end. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_if_not (ForwardIt begin, EndIt end, UnaryPredicate &&pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> ForwardIt |
| Finds the first value in range [begin, end) for which pred returns false. If not found, returns end. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename Elem > |
constexpr auto | find_last (ForwardIt begin, EndIt end, const Elem &value) noexcept(noexcept(*begin==value)) -> ForwardIt |
| Searches a range for the last occurence of a match, and returns an iterator to it. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_last_if (ForwardIt begin, EndIt end, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> ForwardIt |
| Searches a range for the last element on which a predicate returns true. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_last_if_not (ForwardIt begin, EndIt end, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> ForwardIt |
| Searches a range for the last element on which a predicate returns false. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename Elem > |
constexpr auto | find_in (ForwardIt begin, EndIt end, const Elem &value) noexcept(noexcept(*begin==value)) -> size_t |
| Find the offset of the first ocurrence of v in a range from the beginning. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_in_if (ForwardIt begin, EndIt end, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> size_t |
| Find the offset of the first element for which p returns true. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_in_if_not (ForwardIt begin, EndIt end, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> size_t |
| Find the offset of the first element for which p returns false. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename Elem > |
constexpr auto | find_last_in (ForwardIt begin, EndIt end, const Elem &value) noexcept(noexcept(*begin==value)) -> size_t |
| Find the offset of the last ocurrence of v in a range from the beginning. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_last_in_if (ForwardIt begin, EndIt end, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> size_t |
|
template<typename ForwardIt , typename EndIt , typename UnaryPredicate > |
constexpr auto | find_last_in_if_not (ForwardIt begin, EndIt end, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *begin))) -> size_t |
| Find the offset of the last element for which p returns false. It also allows for a sentinel end iterator. More...
|
|
template<typename Container , typename T > |
constexpr auto | find_in (const Container &c, const T &value) noexcept(noexcept(*std::declval< iterator_type_for_t< const Container > & >()==value)) -> size_t |
| Find the first element in c equal to v and return the position. More...
|
|
template<typename Container , typename UnaryPredicate > |
constexpr auto | find_in_if (const Container &c, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *std::declval< iterator_type_for_t< const Container > & >()))) -> size_t |
| Find the first element in c for which p returns true and return the position. More...
|
|
template<typename Container , typename UnaryPredicate > |
constexpr auto | find_in_if_not (const Container &c, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *std::declval< iterator_type_for_t< const Container > & >()))) -> size_t |
| Find the first element in c for which p returns false and return the position. More...
|
|
template<typename Container , typename T > |
constexpr auto | find_last_in (const Container &c, const T &value) noexcept(noexcept(*std::declval< iterator_type_for_t< const Container > & >()==value)) -> size_t |
| Find the last element in c equal to v and return the position. More...
|
|
template<typename Container , typename UnaryPredicate > |
constexpr auto | find_last_in_if (const Container &c, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *std::declval< iterator_type_for_t< const Container > & >()))) -> size_t |
| Find the last element in c for which p returns true and return the position. More...
|
|
template<typename Container , typename UnaryPredicate > |
constexpr auto | find_last_in_if_not (const Container &c, UnaryPredicate pred) noexcept(noexcept(kblib::invoke(pred, *std::declval< iterator_type_for_t< const Container > & >()))) -> size_t |
| Find the last element in c for which p returns true and return the position. More...
|
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename BinaryPredicate = std::equal_to<>> |
constexpr auto | find_match (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, BinaryPredicate cmp) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value and is_invocable< BinaryPredicate, decltype(*begin1), decltype(*begin2)>::value, std::pair< InputIt1, InputIt2 > > |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename EndIt2 , typename BinaryPredicate = std::equal_to<>> |
constexpr auto | find_match (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, EndIt2 end2, BinaryPredicate cmp) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value and is_invocable< BinaryPredicate, decltype(*begin1), decltype(*begin2)>::value, std::pair< InputIt1, InputIt2 > > |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename EndIt2 , typename BinaryPred > |
constexpr auto | starts_with (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, EndIt2 end2, BinaryPred pred) -> enable_if_t<(is_input_iterator_v< InputIt1 > and is_input_iterator_v< InputIt2 >) and not(is_random_access_iterator_v< InputIt1 > and is_random_access_iterator_v< InputIt2 >), bool > |
| Checks if a given range starts with a particular subrange. More...
|
|
template<typename RandomAccessIt1 , typename RandomAccessIt2 , typename BinaryPred = std::equal_to<>> |
constexpr auto | starts_with (RandomAccessIt1 begin1, RandomAccessIt1 end1, RandomAccessIt2 begin2, RandomAccessIt2 end2, BinaryPred pred={}) -> enable_if_t< is_random_access_iterator_v< RandomAccessIt1 > and is_random_access_iterator_v< RandomAccessIt2 >, bool > |
| Checks if a given range starts with a particular subrange. More...
|
|
template<typename BidirIt1 , typename BidirIt2 , typename BinaryPred = std::equal_to<>> |
constexpr auto | ends_with (BidirIt1 begin1, BidirIt1 end1, BidirIt2 begin2, BidirIt2 end2, BinaryPred pred={}) -> enable_if_t<(is_bidirectional_iterator_v< BidirIt1 > and is_bidirectional_iterator_v< BidirIt2 >) and not(is_random_access_iterator_v< BidirIt1 > and is_random_access_iterator_v< BidirIt2 >), bool > |
| Checks if a given range ends with a particular subrange. More...
|
|
template<typename RandomAccessIt1 , typename RandomAccessIt2 , typename BinaryPred = std::equal_to<>> |
constexpr auto | ends_with (RandomAccessIt1 begin1, RandomAccessIt1 end1, RandomAccessIt2 begin2, RandomAccessIt2 end2, BinaryPred pred={}) -> enable_if_t< is_random_access_iterator_v< RandomAccessIt1 > and is_random_access_iterator_v< RandomAccessIt2 >, bool > |
| Checks if a given range ends with a particular subrange. More...
|
|
template<typename InputIt , typename EndIt , typename T , typename UnaryTransform > |
constexpr auto | first_result (InputIt begin, EndIt end, T def, UnaryTransform op) -> enable_if_t< is_input_iterator< InputIt >::value, std::decay_t< decltype(op(*begin))> > |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename T , typename BinaryTransform > |
constexpr auto | first_result (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, T def, BinaryTransform op) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, std::decay_t< decltype(op(*begin1, *begin2))> > |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename EndIt2 , typename T , typename BinaryTransform > |
constexpr auto | first_result (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, EndIt2 end2, T def, BinaryTransform op) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, std::decay_t< decltype(op(*begin1, *begin2))> > |
|
template<typename InputIt , typename EndIt , typename T , typename UnaryTransform , typename UnaryPredicate > |
constexpr auto | first_result_if (InputIt begin, EndIt end, T def, UnaryTransform op, UnaryPredicate ch) -> enable_if_t< is_input_iterator< InputIt >::value, decltype(op(*begin))> |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename T , typename BinaryTransform , typename BinaryPredicate > |
constexpr auto | first_result_if (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, T def, BinaryTransform op, BinaryPredicate ch) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, decltype(op(*begin1, *begin2))> |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename EndIt2 , typename T , typename BinaryTransform , typename BinaryPredicate > |
constexpr auto | first_result_if (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, EndIt2 end2, T def, BinaryTransform op, BinaryPredicate ch) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, decltype(op(*begin1, *begin2))> |
|
template<typename InputIt , typename EndIt , typename T , typename UnaryTransform > |
constexpr auto | first_result_opt (InputIt begin, EndIt end, T def, UnaryTransform op) -> enable_if_t< is_input_iterator< InputIt >::value, std::decay_t< decltype(op(*begin))> > |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename T , typename BinaryTransform > |
constexpr auto | first_result_opt (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, T def, BinaryTransform op) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, std::decay_t< decltype(op(*begin1, *begin2))> > |
|
template<typename InputIt1 , typename EndIt1 , typename InputIt2 , typename EndIt2 , typename T , typename BinaryTransform > |
constexpr auto | first_result_opt (InputIt1 begin1, EndIt1 end1, InputIt2 begin2, EndIt2 end2, T def, BinaryTransform op) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, std::decay_t< decltype(op(*begin1, *begin2))> > |
|
template<typename InputIt , typename UnaryPredicate > |
constexpr auto | all_of (InputIt begin, InputIt end, UnaryPredicate pred) -> enable_if_t< is_input_iterator< InputIt >::value, bool > |
| Determine if pred is true for every element of the range. More...
|
|
template<typename Range , typename UnaryPredicate > |
constexpr auto | all_of (Range &&rng, UnaryPredicate pred) -> enable_if_t< is_iterable< Range >::value, bool > |
| Determine if pred is true for every element of the range. More...
|
|
template<typename InputIt , typename UnaryPredicate > |
constexpr auto | none_of (InputIt begin, InputIt end, UnaryPredicate pred) -> enable_if_t< is_input_iterator< InputIt >::value, bool > |
| Determine if pred is false for every element of the range. More...
|
|
template<typename Range , typename UnaryPredicate > |
constexpr auto | none_of (Range &&rng, UnaryPredicate pred) -> enable_if_t< is_iterable< Range >::value, bool > |
| Determine if pred is true for every element of the range. More...
|
|
template<typename InputIt , typename UnaryPredicate > |
constexpr auto | any_of (InputIt begin, InputIt end, UnaryPredicate pred) -> enable_if_t< is_input_iterator< InputIt >::value, bool > |
| Determine if pred is true for at least one element of the range. More...
|
|
template<typename Range , typename UnaryPredicate > |
constexpr auto | any_of (Range &&rng, UnaryPredicate pred) -> enable_if_t< is_iterable< Range >::value, bool > |
| Determine if pred is true for every element of the range. More...
|
|
template<typename InputIt , typename Value > |
constexpr auto | contains (InputIt begin, InputIt end, const Value &val) noexcept(noexcept(*begin==val)) -> enable_if_t< is_input_iterator< InputIt >::value, bool > |
| Determine if a range contains a value. More...
|
|
template<typename Set , typename Value > |
constexpr auto | contains (const Set &set, const Value &val) noexcept(noexcept(*std::declval< iterator_type_for_t< const Set > & >()==val)) -> enable_if_t< is_iterable< Set >::value, bool > |
| Determine if a range contains a value. More...
|
|
template<typename InputIt1 , typename InputIt2 > |
constexpr auto | contains_any (InputIt1 begin, InputIt1 end, InputIt2 n_begin, InputIt2 n_end) -> enable_if_t< is_input_iterator< InputIt1 >::value and is_input_iterator< InputIt2 >::value, bool > |
|
template<typename InputIt , typename Range2 > |
constexpr auto | contains_any (InputIt begin, InputIt end, Range2 &&needle) -> enable_if_t< is_input_iterator< InputIt >::value and is_iterable< Range2 >::value, bool > |
|
template<typename Range1 , typename Range2 > |
constexpr auto | contains_any (Range1 &&haystack, Range2 &&needle) -> enable_if_t< is_iterable< Range1 >::value and is_iterable< Range2 >::value, bool > |
|
template<typename ForwardIt , typename EndIt , typename Compare = std::less<>> |
constexpr auto | max_element (ForwardIt first, EndIt last, Compare comp={}) -> ForwardIt |
|
template<typename SequenceContainer , typename Comp = std::less<>, typename It , enable_if_t< is_linear_container_v< SequenceContainer >, int > = 0> |
constexpr auto | get_max_n_old (It first, It last, std::size_t count, Comp cmp={}) -> SequenceContainer |
| Returns a container of the greatest count elements according to cmp of the range [first, last), in arbitrary order. This overload works for linear containers. More...
|
|
template<typename SequenceContainer , typename Comp = std::less<>, typename It , enable_if_t< is_linear_container_v< SequenceContainer >, int > = 0> |
constexpr auto | get_max_n (It first, It last, std::size_t count, Comp cmp={}) -> SequenceContainer |
| Returns a container of the greatest count elements according to cmp of the range [first, last), in descending order. This overload works for linear containers. More...
|
|
template<typename Comp = std::less<>, typename InputIt , typename OutputIt , typename Elem = typename std::iterator_traits<InputIt>::value_type> |
constexpr auto | get_max_n (InputIt first, InputIt last, OutputIt d_begin, std::size_t count, Comp cmp={}) -> return_assert_t< is_output_iterator_for< OutputIt, Elem >::value, OutputIt > |
| Copies the count greatest elements according to cmp of the range [first, last) to the range beginning at d_begin. More...
|
|
template<typename ForwardIt , typename EndIt , typename ForwardIt2 , typename BinaryFunction > |
constexpr auto | for_each (ForwardIt first, EndIt last, ForwardIt2 second, BinaryFunction f) -> BinaryFunction |
| Applies a binary operation to each pair of corresponding elements in two input ranges. It also allows for a sentinel end iterator. More...
|
|
template<typename ForwardIt , typename ForwardIt2 , typename Size , typename BinaryFunction > |
constexpr auto | for_each_n (ForwardIt first, Size n, ForwardIt2 second, BinaryFunction f) -> std::pair< ForwardIt, ForwardIt2 > |
| Applies a binary operation to each pair of corresponding elements in two input ranges. More...
|
|
template<typename InputIt , typename EndIt , typename OutputIt > |
constexpr auto | copy (InputIt first, EndIt last, OutputIt out) -> OutputIt |
| Copies all elements of [first , last ) to out. It also allows for a sentinel end iterator. More...
|
|
template<typename InputIt , typename EndIt , typename OutputIt , typename UnaryPredicate > |
constexpr auto | copy_if (InputIt first, EndIt last, OutputIt out, UnaryPredicate pred) -> OutputIt |
| Copies those elements of [first , last ) which satisfy pred to out. It also allows for a sentinel end iterator. More...
|
|
template<typename InputIt , typename Size , typename OutputIt > |
constexpr auto | copy_n (InputIt first, Size count, OutputIt out) -> OutputIt |
| Copies all elements of [first , std::advance(first, n) ) to out. More...
|
|
template<typename InputIt , typename Size , typename OutputIt , typename UnaryPredicate > |
constexpr auto | copy_n_if (InputIt first, Size count, OutputIt out, UnaryPredicate pred) -> OutputIt |
| Copies those elements of [first , std::advance(first, n) ) which satisfy pred to out. More...
|
|
template<typename InputIt , typename EndIt , typename OutputIt , typename UnaryPredicate , typename T > |
constexpr auto | replace_copy_if (InputIt first, EndIt last, OutputIt out, UnaryPredicate pred, const T &new_value) -> OutputIt |
| Copies an input range, but every element for which pred is true is replaced by new_value. It also allows for a sentinel end iterator. More...
|
|
template<typename InputIt , typename Size , typename OutputIt , typename UnaryPredicate , typename T > |
constexpr auto | replace_copy_n_if (InputIt first, Size count, OutputIt out, UnaryPredicate pred, const T &new_value) -> OutputIt |
| Copies an input range, but every element for which pred is true is replaced by new_value. More...
|
|
template<typename ForwardIt1 , typename ForwardIt2 , typename ForwardIt3 , typename OutputIt , typename BinaryPredicate = std::equal_to<>> |
constexpr auto | search_replace_copy (ForwardIt1 h_begin, ForwardIt1 h_end, ForwardIt2 n_begin, ForwardIt2 n_end, ForwardIt3 r_begin, ForwardIt3 r_end, OutputIt d_begin, BinaryPredicate Compare={}) -> OutputIt |
|
template<typename Haystack , typename Needle , typename Replacement , typename OutputIt , typename BinaryPredicate = std::equal_to<>> |
constexpr auto | search_replace_copy (Haystack &&haystack, Needle &&needle, Replacement &&replacement, OutputIt d_begin, BinaryPredicate compare={}) |
|
template<class ForwardIt > |
constexpr auto | rotate (ForwardIt first, ForwardIt n_first, ForwardIt last) noexcept(noexcept(swap(*first, *first))) -> ForwardIt |
| Rotates the input range. This is just a constexpr-in-C++14 version of std::rotate. More...
|
|
template<typename OutputIt , typename EndIt , typename Generator > |
constexpr auto | generate (OutputIt first, EndIt last, Generator g) noexcept(noexcept(*++first=g())) -> OutputIt |
| Like std::generate except that it returns the output iterator at the end. It also allows for a sentinel end iterator. More...
|
|
template<typename OutputIt , typename Size , typename Generator > |
constexpr auto | generate_n (OutputIt first, Size count, Generator g) noexcept(noexcept(*first++=g())) -> OutputIt |
| Like std::generate_n except that it is constexpr. More...
|
|
template<typename ForwardIt , typename T > |
constexpr auto | iota (ForwardIt first, ForwardIt last, T value) noexcept(noexcept(*first++=value) and noexcept(++value)) -> void |
|
template<typename ForwardIt , typename T , typename UnaryOperation > |
constexpr auto | iota (ForwardIt first, ForwardIt last, T value, UnaryOperation unary_op) noexcept(noexcept(*first++=value) and noexcept(kblib::invoke(unary_op, std::move(value)))) -> void |
|
template<typename InputIt , typename EndIt , typename... Params> |
constexpr auto | call_each (InputIt first, EndIt last, Params &&... params) noexcept(noexcept(kblib::invoke(*first++, std::forward< Params >(params)...))) -> InputIt |
|
template<typename InputIt , typename EndIt , typename OutputIt , typename UnaryOperation > |
constexpr auto | transform (InputIt first, EndIt last, OutputIt d_first, UnaryOperation unary_op) -> OutputIt |
| transform applies the given function to a range and stores the result in another range, beginning at d_first. The unary operation unary_op is applied to the range defined by [first1, last1). It also allows for a sentinel end iterator. More...
|
|
template<typename InputIt , typename EndIt , typename InputIt2 , typename OutputIt , typename BinaryOperation > |
constexpr auto | transform (InputIt first, EndIt last, InputIt first2, OutputIt d_first, BinaryOperation binary_op) -> OutputIt |
| transform applies the given function to a range and stores the result in another range, beginning at d_first. The unary operation unary_op is applied to the range defined by [first1, last1). It also allows for a sentinel end iterator. More...
|
|
template<typename InputIt , typename EndIt , typename OutputIt , typename UnaryPredicate , typename UnaryOperation > |
constexpr auto | transform_if (InputIt first, EndIt last, OutputIt d_first, UnaryPredicate pred, UnaryOperation unary_op) -> OutputIt |
| transform applies the given function to a range and stores the result in another range, beginning at d_first. The unary operation unary_op is applied to the range defined by [first1, last1). It also allows for a sentinel end iterator. More...
|
|
constexpr auto | memswap (unsigned char *A, unsigned char *B, std::size_t size) noexcept -> void |
| Swaps memory ranges. More...
|
|
auto | memswap (void *A, void *B, std::size_t size) noexcept -> void |
| Swaps memory ranges. More...
|
|
template<std::size_t I, typename... Types> |
auto | get (punner< Types... > &p) noexcept -> decltype(auto) |
|
template<std::size_t I, typename... Types> |
auto | get (const punner< Types... > &p) noexcept -> decltype(auto) |
|
template<std::size_t I, typename... Types> |
auto | get (punner< Types... > &&p) noexcept -> decltype(auto) |
|
template<std::size_t I, typename... Types> |
auto | get (const punner< Types... > &&p) noexcept -> decltype(auto) |
|
template<typename Container , typename InputIt , typename UnaryFunction > |
auto | build (InputIt first, InputIt last, UnaryFunction f, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
| Constructs a container by applying a UnaryFunction to every element of an input range. More...
|
|
template<typename Container , typename InputIt , typename InputIt2 , typename BinaryFunction > |
auto | build (InputIt first, InputIt last, InputIt2 first2, BinaryFunction f, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
| Constructs a container by applying a BinaryFunction to every pair of elements in the input ranges. More...
|
|
template<typename Array , typename InputIt , typename UnaryFunction , enable_if_t< not is_resizable_v< Array >, int > = 0> |
auto | build (InputIt first, InputIt last, UnaryFunction f) -> Array |
| Constructs an array-like container by applying a UnaryFunction to every element of an input range. More...
|
|
template<typename Array , typename InputIt , typename InputIt2 , typename BinaryFunction , enable_if_t< not is_resizable_v< Array >, int > = 0> |
auto | build (InputIt first, InputIt last, InputIt2 first2, BinaryFunction f) -> Array |
| Constructs an array-like container by applying a BinaryFunction to every pair of elements in the input ranges. More...
|
|
template<typename Container , typename Functor > |
auto | build (Functor f, size_t size, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
| Constructs a container with elements initialized by repeatedly calling a generating function. More...
|
|
template<typename Array , typename Functor , enable_if_t< not is_resizable_v< Array >, int > = 0> |
auto | build (Functor f, size_t size=std::tuple_size< Array >::value) -> Array |
| Constructs an array-like container with elements initialized by repeatedly calling a generating function. More...
|
|
template<typename Container , typename InputIt , typename UnaryFunction > |
auto | build_dy (InputIt first, InputIt last, UnaryFunction f) -> Container |
| Constructs a container by applying a UnaryFunction to every element of an input range. Exactly like build , but for resizable non-AllocatorAware Containers (which are hard to detect automatically). More...
|
|
template<typename Container , typename InputIt , typename InputIt2 , typename BinaryFunction > |
auto | build_dy (InputIt first, InputIt last, InputIt2 first2, BinaryFunction f) -> Container |
| Constructs a container by applying a BinaryFunction to every pair of elements in the input ranges. Exactly like build , but for resizable non-AllocatorAware Containers (which are hard to detect automatically). More...
|
|
template<typename Container , typename Functor > |
auto | build_dy (Functor f, size_t size) -> Container |
| Constructs a container with elements initialized by repeatedly calling a generating function. Exactly like build , but for resizable non-AllocatorAware Containers (which are hard to detect automatically). More...
|
|
template<typename Container , typename Range , typename UnaryFunction , enable_if_t< is_resizable_v< Container >, int > = 0> |
auto | build_dy (Range &&r, UnaryFunction f) -> Container |
|
template<typename Container , typename... Args> |
constexpr auto | buildiota (Args &&... args) -> auto |
| Builds a container of increasing values. More...
|
|
template<typename Container , typename InputIt > |
auto | build_copy (InputIt first, InputIt last, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
|
template<typename Container , typename Range , enable_if_t< is_resizable_v< Container >, int > = 0> |
auto | build_copy (Range &&r) -> Container |
|
template<typename Container , typename Range > |
auto | build_copy (Range &&r, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
|
template<typename Container , typename InputIt , enable_if_t< not is_resizable_v< Container >, int > = 0> |
constexpr auto | build_copy (InputIt first, InputIt last) -> Container |
|
template<typename Container , typename Range , enable_if_t< not is_resizable_v< Container >, int > = 0> |
constexpr auto | build_copy (Range &&r) -> Container |
|
template<typename Container , typename InputIt , enable_if_t< not is_resizable_v< Container >, int > = 0> |
auto | build_copy (InputIt first, InputIt last, std::size_t size) -> Container |
|
template<typename Container , typename Range , enable_if_t< not is_resizable_v< Container >, int > = 0> |
auto | build_copy (Range &&r, std::size_t size) -> Container |
|
template<typename Container , typename InputIt , typename Predicate > |
auto | build_copy_if (InputIt first, InputIt last, Predicate f, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
|
template<typename Container , typename InputIt , typename Size > |
auto | build_copy_n (InputIt first, Size count, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
|
template<typename Container , typename InputIt , typename Size , typename Predicate > |
auto | build_copy_n_if (InputIt first, Size count, Predicate f, typename Container::allocator_type allocator=typename Container::allocator_type{}) -> Container |
|
template<typename C > |
constexpr auto | pop (C &s) -> typename C::value_type |
|
template<class C , typename K , typename V > |
constexpr auto | get_or (const C &m, const K &key, const V &defval) -> typename C::mapped_type |
|
template<typename Map , typename Key > |
constexpr auto | try_get (Map &map, Key &&key) -> copy_const_t< Map, typename Map::mapped_type > * |
|
template<typename M , typename K > |
constexpr auto | get_check (M &&m, const K &key) noexcept(noexcept(m.find(key) !=m.end())) -> exists_t< decltype(m.find(key))> |
|
template<typename V > |
auto | force_shrink_to_fit (V &vec) -> void |
| std::vector::shrink_to_fit is non-binding, which means that there is no guaranteed way to shrink a vector via its API. This function is a roundabout way of doing that without relying on the sanity of the implementation (except that it assumes that a vector won't significantly over-allocate on sized construction). More...
|
|
template<typename Container , typename Range > |
constexpr auto | construct_from_range (Range &&r) -> Container |
| Allows for constructing a container of a specified type from a range object. Copy elision means that this does not result in any extra copies. More...
|
|
template<int base, typename Int > |
constexpr auto | to_string (Int num) -> std::string |
|
template<typename Int > |
constexpr auto | to_string (Int num, int base) -> std::string |
|
template<typename Result > |
constexpr auto | parse_integer (const char *begin, const char *end, int base=0) -> Result |
|
template<typename Result , std::size_t N> |
constexpr auto | parse_integer (const char(&in)[N], int base=0) -> Result |
|
template<typename Result > |
constexpr auto | parse_integer (const std::string &in, int base=0) -> Result |
|
template<typename Result > |
constexpr auto | parse_integer (std::string_view in, int base=0) -> Result |
|
template<char... Cs> |
constexpr auto | operator""_c () |
|
template<char... Cs> |
constexpr auto | operator""_cu () |
|
template<typename E , typename = typename std::enable_if<std::is_enum<E>::value>::type> |
constexpr auto | etoi (E e) -> auto |
|
template<int maxBufLen = 4096, typename clock , typename duration > |
auto | time_to_str (std::chrono::time_point< clock, duration > &tp, const std::string &fmt="%F %T") -> std::string |
|
template<typename Rep , typename Ratio , enable_if_t< detail_units::is_si_ratio< typename Ratio::type >::value > * = nullptr> |
constexpr auto | duration_to_str (std::chrono::duration< Rep, Ratio > &d) -> std::string |
|
template<typename Rep > |
constexpr auto | duration_to_str (std::chrono::duration< Rep, std::ratio< 60 > > d) -> std::string |
|
template<typename Rep > |
constexpr auto | duration_to_str (std::chrono::duration< Rep, std::ratio< 3600 > > d) -> std::string |
|
template<typename string > |
auto | url_encode (const string &value) -> std::string |
|
template<typename string > |
constexpr auto | html_encode (const string &data) -> std::string |
|
constexpr auto | escapify (char c) -> std::string |
|
template<typename string > |
auto | escapify (const string &value) -> std::string |
|
template<typename string > |
constexpr auto | calculate_translated_index (string &&value, const char *p) -> std::ptrdiff_t |
|
constexpr auto | calculate_translated_index (const char *value, const char *p) -> std::ptrdiff_t |
|
template<typename character , enable_if_t< is_character_v< character > > * = nullptr> |
constexpr auto | quoted (character c) -> std::string |
|
template<typename string , enable_if_t< not is_character_v< string > > * = nullptr> |
auto | quoted (string &&in) -> std::string |
|
template<typename T > |
auto | fromStr (const std::string &val, const char *type=typeid(T).name()) -> T |
|
template<> |
constexpr auto | fromStr (const std::string &val, const char *) -> std::string |
|
template<> |
constexpr auto | fromStr (const std::string &val, const char *type) -> bool |
|
template<typename T > |
auto | fromStr (std::string &&val, const char *type=typeid(T).name()) -> T |
|
template<> |
constexpr auto | fromStr (std::string &&val, const char *) -> std::string |
|
template<> |
constexpr auto | fromStr (std::string &&val, const char *type) -> bool |
|
template<> |
constexpr auto | fromStr (const std::string &val, const char *) -> std::string_view |
|
template<> |
auto | fromStr (std::string &&, const char *) -> std::string_view=delete |
|
template<typename T > |
auto | fromStr (std::string_view val, const char *type=typeid(T).name()) -> T |
|
template<> |
constexpr auto | fromStr (std::string_view val, const char *) -> std::string_view |
|
template<> |
constexpr auto | fromStr (std::string_view val, const char *) -> std::string |
|
template<> |
constexpr auto | fromStr (std::string_view val, const char *type) -> bool |
|
template<typename To , std::size_t N> |
constexpr auto | fromStr (const char(&val)[N], const char *type=typeid(To).name()) -> To |
|
template<typename To , typename _ > |
constexpr auto | fromStr (const char *val, const char *type=typeid(To).name(), _=0) -> To |
|
template<typename T > |
auto | toStr (T val) -> std::string |
|
constexpr auto | toStr (std::string val) -> std::string |
|
template<typename To , typename From > |
constexpr auto | lexical_cast (const From &val, const char *type=typeid(To).name()) -> To |
|
template<typename Range > |
auto | cry_enumerate (Range &&range) -> auto |
|
template<typename Range > |
constexpr auto | enumerate (Range &&r) -> enumerate_t< Range && > |
| Allow access to indexes while using range-based for loops. Safe to use with rvalues. More...
|
|
template<typename It , typename EIt > |
constexpr auto | enumerate (It begin, EIt end) -> enumerate_t< It, EIt > |
| Allow access to indexes while using range-based for loops. More...
|
|
template<typename F , typename... Args> |
constexpr auto | invoke (F &&f, Args &&... args) noexcept(noexcept(detail::do_invoke(std::forward< F >(f), std::forward< Args >(args)...))) -> decltype(auto) |
|
template<typename F , typename Arg > |
constexpr auto | apply (F &&f, Arg &&arg) noexcept(noexcept(detail::apply_impl< F, Arg >::do_apply(std::forward< F >(f), std::forward< Arg >(arg), std::index_sequence< std::tuple_size< Arg >::value >{}))) -> decltype(auto) |
|
template<typename T > |
auto | to_unique (owner< T * > p) -> std::unique_ptr< T > |
|
template<typename T , typename D > |
auto | to_unique (owner< T * > p, D &&d) -> std::unique_ptr< T, D > |
|
template<typename I > |
constexpr auto | to_unsigned (I x) -> std::make_unsigned_t< I > |
| Cast integral argument to corresponding unsigned type. More...
|
|
template<typename I > |
constexpr auto | to_signed (I x) -> std::make_signed_t< I > |
| Cast integral argument to corresponding signed type. More...
|
|
template<typename A , typename F > |
constexpr auto | signed_cast (F x) -> enable_if_t< std::is_integral< A >::value and std::is_integral< F >::value and std::is_signed< A >::value, std::make_signed_t< F > > |
| Cast argument to equivalently-sized type with the same signednessas the template parameter. More...
|
|
template<typename T , typename U = T> |
constexpr auto | exchange (T &obj, U &&new_value) -> T |
|
template<typename N > |
constexpr auto | signed_promote (N x) noexcept -> safe_signed_t< N > |
|
template<class InputIt1 , class InputIt2 > |
constexpr auto | equal (InputIt1 first1, InputIt1 last1, InputIt2 first2) -> bool |
|
template<typename InputIt1 , typename InputIt2 , typename BinaryPredicate , typename kblib::enable_if_t< not std::is_same< InputIt2, BinaryPredicate >::value, int > = 0> |
constexpr auto | equal (InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPredicate p) -> bool |
|
template<class RandomIt1 , class RandomIt2 , typename kblib::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< RandomIt1 >::iterator_category >::value and std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< RandomIt2 >::iterator_category >::value, int > = 0> |
constexpr auto | equal (RandomIt1 first1, RandomIt1 last1, RandomIt2 first2, RandomIt2 last2) -> bool |
|
template<class RandomIt1 , class RandomIt2 , typename BinaryPredicate , typename kblib::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< RandomIt1 >::iterator_category >::value and std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< RandomIt2 >::iterator_category >::value, int > = 0> |
constexpr auto | equal (RandomIt1 first1, RandomIt1 last1, RandomIt2 first2, RandomIt2 last2, BinaryPredicate p) -> bool |
|
template<class InputIt1 , class InputIt2 , typename kblib::enable_if_t< not std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< InputIt1 >::iterator_category >::value or not std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< InputIt2 >::iterator_category >::value, int > = 0> |
constexpr auto | equal (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) -> bool |
|
template<typename InputIt1 , typename InputIt2 , typename BinaryPredicate , typename kblib::enable_if_t< not std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< InputIt1 >::iterator_category >::value or not std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< InputIt2 >::iterator_category >::value, int > = 0> |
constexpr auto | equal (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, BinaryPredicate p) -> bool |
|
template<typename C > |
constexpr auto | size (const C &c) -> decltype(c.size()) |
|
template<typename T , std::size_t N> |
constexpr auto | size (const T(&)[N]) noexcept -> std::size_t |
|
template<class InputIt1 , class InputIt2 > |
constexpr auto | lexicographical_compare (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) -> bool |
|
template<typename Number > |
constexpr auto | count_digits (Number val) -> enable_if_t< std::is_floating_point< Number >::value, int > |
| Calculates the number of decimal digits needed to represent a number, plus one for negative numbers. More...
|
|
template<typename Number > |
constexpr auto | count_digits (Number val, int base) -> int |
| Calculates the number of digits needed to represent a number in a given base, plus one for negative numbers. More...
|
|
template<typename ForwardIt > |
constexpr auto | max_count_digits (ForwardIt first, ForwardIt last) -> int |
| Returns the necessary number of digits to represent the largest value in an input range. More...
|
|
template<typename ForwardIt > |
constexpr auto | max_count_digits (ForwardIt first, ForwardIt last, int base) -> int |
| Returns the necessary number of digits to represent the largest value in an input range. More...
|
|
template<typename Integral , typename CharT > |
constexpr auto | to_bytes_le (Integral ival, CharT(&dest)[sizeof(Integral)]) noexcept -> void |
|
template<typename Integral , typename CharT > |
constexpr auto | to_bytes_be (Integral ival, CharT(&dest)[sizeof(Integral)]) noexcept -> void |
|
template<typename Integral , typename CharT > |
constexpr auto | to_bytes (Integral val, CharT(&dest)[sizeof(Integral)]) noexcept -> void |
|
template<typename HashInt , typename Span > |
constexpr auto | FNVa (Span &&s, HashInt hval=fnv::fnv_offset< HashInt >::value) noexcept -> HashInt |
| A templatized generic FNVa hash function. More...
|
|
template<typename HashInt , typename CharT , std::size_t N> |
constexpr auto | FNVa_a (const CharT(&s)[N], HashInt hval=fnv::fnv_offset< HashInt >::value) noexcept -> HashInt |
| A templatized FNVa hash function, for raw character arrays, such as string literals. More...
|
|
constexpr auto | FNV32a (std::string_view s, std::uint32_t hval=fnv::fnv_offset< std::uint32_t >::value) noexcept -> std::uint32_t |
| A standard FNV32a hash function, for string_views. More...
|
|
template<typename HashInt > |
constexpr auto | FNVa_s (const char *begin, std::size_t length, HashInt hval=fnv::fnv_offset< HashInt >::value) noexcept -> HashInt |
|
template<std::size_t N> |
constexpr auto | FNV32a_a (const char(&s)[N], std::uint32_t hval=fnv::fnv_offset< std::uint32_t >::value) noexcept -> std::uint32_t |
| A standard FNV32a hash function, for raw character arrays, such as string literals. More...
|
|
constexpr auto | FNV32a_s (const char *begin, std::size_t length, uint32_t hval=fnv::fnv_offset< std::uint32_t >::value) noexcept -> std::uint32_t |
|
constexpr auto | operator""_fnv32 (const char *str, std::size_t length) noexcept -> std::uint32_t |
| A literal suffix that produces the FNV32a hash of a string literal. More...
|
|
constexpr auto | operator""_fnv64 (const char *str, std::size_t length) noexcept -> std::uint64_t |
| A literal suffix that produces the FNV64a hash of a string literal. More...
|
|
constexpr auto | operator""_fnv32 (unsigned long long val) -> std::uint32_t |
|
constexpr auto | operator""_fnv64 (unsigned long long val) -> std::uint64_t |
|
template<typename string = std::string> |
auto | toUTF8 (const icu::UnicodeString &s) -> string |
| Convert a UnicodeString to a UTF-8 string. More...
|
|
template<typename string > |
auto | fromUTF8 (string s) -> icu::UnicodeString |
| Convert a UTF-8 string into a UnicodeString. More...
|
|
template<typename string = std::u32string> |
auto | toUTF32 (const icu::UnicodeString &s) -> string |
| Converts a UnicodeString to UTF-32. More...
|
|
template<typename string > |
auto | fromUTF32 (string s) -> icu::UnicodeString |
| Converts a UTF-32 string into a UnicodeString. More...
|
|
template<typename T > |
auto | fromStr (const icu::UnicodeString &val, const char *type=typeid(T).name()) -> T |
| Reencodes val to UTF-8 and then converts it to T using the primary overload. More...
|
|
template<typename D = std::string, typename std::enable_if_t< is_contiguous_v< D >, int > = 0> |
auto | get_contents (std::istream &in, D &out) -> auto |
|
template<typename D = std::string, typename string > |
auto | get_file_contents (const string &filename) -> std::optional< D > |
| Read the entire contents of a file into a container, such as std::string or std::vector<char>. Note that it will be most efficient to read into contiguous containers, as opposed to non-contiguous containers. More...
|
|
template<typename D = std::string, typename string > |
auto | try_get_file_contents (const string &filename) -> D |
| Read the entire contents of a file into a container, such as std::string or std::vector<char>. Note that it will be most efficient to read into contiguous containers, as opposed to non-contiguous containers. More...
|
|
auto | getline (std::istream &is) -> std::string |
| By-value std::getline wrapper. More...
|
|
auto | eat_word (std::istream &is) -> std::istream & |
| Consume all non-spaces to first break, then eat that, too. More...
|
|
std::istream & | eat_space (std::istream &is) |
| Eat spaces, don't eat an extra. More...
|
|
template<typename CharT , typename Traits > |
auto | nl (std::basic_istream< CharT, Traits > &is) -> std::basic_istream< CharT, Traits > & |
| Read in spaces until the end of the line is found. More...
|
|
template<typename CharT > |
auto | unformatted_expect (CharT c) -> auto |
| Read a character from an input stream only if it equals c. Acts as an UnformattedInputOperation, that is, it will not ignore any leading whitespace. More...
|
|
template<typename CharT > |
auto | expect (CharT c) -> auto |
| Read a character from an input stream only if it equals c. Acts as a FormattedInputOperation, that is, leading whitespace is ignored. More...
|
|
template<typename CharT , typename... O, template< typename, typename... > class string> |
auto | get_line (string< CharT, O... > &str) -> auto |
| Read a whole line into a std::basic_string-like class template. More...
|
|
template<typename CharT , typename... O, template< typename, typename... > class string> |
auto | get_line (string< CharT, O... > &str, CharT delim) -> auto |
| Read a delimited string into a std::basic_string-like class template. More...
|
|
template<typename F , typename CharT , typename Tr > |
std::basic_istream< CharT, Tr > & | operator>> (std::basic_istream< CharT, Tr > &is, get_manip< F > func) |
| Actually calls the manipulator. More...
|
|
template<typename F , typename CharT , typename Tr > |
std::basic_ostream< CharT, Tr > & | operator<< (std::basic_ostream< CharT, Tr > &is, get_manip< F > func) |
| Actually calls the manipulator. More...
|
|
template<typename StreamA , typename StreamB > |
auto | tee (StreamA &a, StreamB &b) -> basic_teestream< StreamA, StreamB > |
|
template<typename File = std::fstream> |
auto | scoped_file (const std::filesystem::path &path, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
|
template<typename File = std::fstream> |
auto | tmpfile (const std::filesystem::path &path, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out) |
|
template<typename P > |
constexpr auto | to_pointer (P &&p) noexcept -> auto * |
| Gets a raw pointer out of any smart pointer or iterator you might pass in, without dereferencing it or relying on a get() method. More...
|
|
template<typename Container , typename Comp = std::less<value_type_linear_t<Container>>> |
auto | max_element (Container &c, Comp comp) -> value_type_linear_t< Container > * |
|
template<typename C > |
counting_back_insert_iterator< C > | counting_back_inserter (C &c, std::size_t count=0) |
|
template<typename T > |
constexpr auto | operator+ (T val, adjuster a) noexcept -> enable_if_t< not detail_iterators::is_addable< T, std::ptrdiff_t >::value, decltype(std::advance(val, a.adj))> |
|
template<typename T > |
constexpr auto | operator+ (T val, incrementer) -> T |
| Increments val. More...
|
|
template<typename T > |
constexpr auto | operator+ (T val, decrementer) -> T |
| Decrements val. More...
|
|
template<typename Value , typename Delta = int> |
constexpr auto | range (Value min, Value max, Delta step=0) -> range_t< Value, Delta > |
| Constructs a range from beginning, end, and step amount. The range is half-open, that is min is in the range but max is not. If unspecified, the step is automatically either 1 or -1, depending on whether max > min. More...
|
|
template<typename Value > |
constexpr auto | range (Value max) -> range_t< Value, incrementer > |
| Constructs a half-open range [0, max). The step is automatically determined based on the sign of max. More...
|
|
template<typename Value , typename Delta = int> |
constexpr auto | irange (Value, Value, Delta=0) |
|
template<std::size_t I, typename T > |
auto | get (enumeration< T > &&e) -> decltype(auto) |
|
template<std::size_t I, typename T > |
auto | get (const enumeration< T > &&e) -> decltype(auto) |
|
template<std::size_t I, typename T > |
auto | get (volatile enumeration< T > &e) -> decltype(auto) |
|
template<std::size_t I, typename T > |
auto | get (const volatile enumeration< T > &e) -> decltype(auto) |
|
template<typename It , typename EIt > |
auto | magic_enumerate (It begin, EIt end) -> enumerator_t< It, EIt > |
| Allow access to indexes while using range-based for loops. More...
|
|
template<typename Range > |
auto | magic_enumerate (Range &&r) -> auto |
| Allow access to indexes while using range-based for loops. Safe to use with rvalues. More...
|
|
template<typename Iter1 , typename Iter2 > |
constexpr auto | indirect (Iter1 begin, Iter2 end) noexcept(noexcept(indirect_range< Iter1, Iter2 >{begin, end})) -> indirect_range< Iter1, Iter2 > |
| Create a range from an iterator pair. Primarily useful for range-for loops. More...
|
|
template<typename Iter1 , typename Iter2 > |
| indirect_range (Iter1, Iter2) -> indirect_range< Iter1, Iter2 > |
|
template<typename Iter1 , typename Iter2 > |
auto | cry_enumerate (Iter1 begin, Iter2 end) -> auto |
|
template<typename It , typename operation > |
| transform_iterator (It, operation) -> transform_iterator< It, operation > |
|
template<typename base_iterator , typename operation > |
auto | make_transform_iterator (base_iterator it, operation op) noexcept(noexcept(transform_iterator< base_iterator, operation >{ it, std::move(op)})) -> transform_iterator< base_iterator, operation > |
| Factory function to make transform_iterators. More...
|
|
template<typename base_iterator , typename operation > |
auto | transformer (base_iterator it, operation op) noexcept(noexcept(transform_iterator< base_iterator, operation >{it, std::move(op)})) -> transform_iterator< base_iterator, operation > |
| Factory function to make transform_iterators. More...
|
|
template<typename It , typename EndIt , typename operation > |
auto | transform_range (It begin, EndIt end, operation op) noexcept(noexcept(indirect(transform_iterator{begin, op}, end))) -> auto |
|
template<typename InputIt1 , typename EndIt , typename InputIt2 > |
auto | zip (InputIt1 begin1, EndIt end1, InputIt2 begin2) noexcept(zip_iterator< InputIt1, EndIt, InputIt2 >::is_nothrow_copyable) -> zip_iterator< InputIt1, EndIt, InputIt2 > |
| Iterate over two ranges in lockstep, like Python's zip. More...
|
|
template<typename Range1 , typename Range2 > |
auto | zip (Range1 &&r1, Range2 &&r2) noexcept(zip_iterator< decltype(begin(r1)), decltype(end(r1)), decltype(begin(r2))>::is_nothrow_copyable) -> zip_iterator< decltype(begin(r1)), decltype(end(r1)), decltype(begin(r2))> |
| Iterate over two ranges in lockstep, like Python's zip. More...
|
|
template<typename F > |
auto | consumer (F f) -> consume_iterator< F > |
| Creates a consume_iterator of deduced type F. More...
|
|
template<typename T , typename Deleter > |
auto | make_cond_ptr (std::unique_ptr< T, Deleter > &&arg) noexcept -> cond_ptr< T, Deleter > |
|
template<typename T > |
auto | make_cond_ptr (T *arg, bool owner=false) noexcept -> cond_ptr< T > |
|
template<typename T , typename Deleter > |
auto | make_cond_ptr (T *arg, Deleter del) noexcept -> cond_ptr< T, Deleter > |
|
template<typename T , typename Deleter > |
auto | make_cond_ptr (T *arg, bool owner, Deleter del) noexcept -> cond_ptr< T, Deleter > |
|
constexpr auto | operator| (construct_type l, construct_type r) noexcept -> construct_type |
|
constexpr auto | operator& (construct_type l, construct_type r) noexcept -> construct_type |
|
constexpr auto | operator* (construct_type l, bool r) noexcept -> construct_type |
|
template<typename T > |
auto | noop (void *, const T *) -> T * |
| Does nothing; matches the copy construction signature. More...
|
|
template<typename T , bool nothrow> |
auto | noop (void *, T *) noexcept(nothrow) -> T * |
| Does nothing; matches the move construction signature. More...
|
|
template<bool warn> |
constexpr auto | poly_warn_if () -> std::nullptr_t |
|
template<> |
constexpr auto | poly_warn_if< true > () -> std::nullptr_t |
|
template<typename Array , typename RandomGenerator , typename freqtype = double> |
constexpr auto | chooseCategorical (Array &&cats, RandomGenerator &r) -> decltype(cats.size()) |
| Given a categorical distribution cats, selects one category. More...
|
|
template<typename Gen , typename Source > |
auto | seeded (Source &&s) -> Gen |
|
template<typename Gen > |
auto | seeded () -> Gen |
|
template<typename UIntType > |
constexpr auto | ipow2 (UIntType b) noexcept -> UIntType |
|
template<typename T > |
constexpr auto | in_range (const T &v, detail_simple::simple_range< T > r) |
|
template<typename T > |
constexpr auto | in_range_i (const T &v, detail_simple::simple_range< T > r) |
|
template<typename F , typename... T> |
constexpr auto | map (F f, T &&... t) noexcept(noexcept(std::tuple{ kblib::apply(f, std::forward< T >(t))...})) -> enable_if_t< not any_void< decltype(kblib::apply(f, std::forward< T >(t)))... >, decltype(std::tuple{kblib::apply(f, std::forward< T >(t))...})> |
|
template<typename F > |
constexpr auto | defer (F f) |
|
template<typename BinaryOperation > |
constexpr auto | flip () -> auto |
| Transforms a stateless binary operation into one which takes reversed arguments. More...
|
|
template<typename BinaryOperation > |
constexpr auto | flip (BinaryOperation op) -> auto |
| Transforms a binary operation into one which takes reversed arguments. More...
|
|
template<typename T , std::size_t N> |
constexpr auto | is_consecutive (const T(&array)[N]) -> enable_if_t< std::is_integral< T >::value, bool > |
|
constexpr auto | filg2 (const std::bitset< std::numeric_limits< std::uintmax_t >::digits > val) noexcept -> int |
| Floored integer binary logarithm. Returns floor(lb(val)). More...
|
|
template<typename T > |
constexpr auto | safe_auto (T &&in) -> T |
| Safely propagate an xvalue or lvalue without dangling references. More...
|
|
template<typename T > |
constexpr auto | safe_auto (T &in) -> T & |
| Safely propagate an xvalue or lvalue without dangling references. More...
|
|
template<typename LeftContainer , typename RightContainer > |
constexpr auto | arraycat (LeftContainer A, RightContainer &&B) noexcept(noexcept(A.insert(A.end(), B.begin(), B.end())) and std::is_nothrow_move_constructible< LeftContainer >::value) -> LeftContainer |
| Concatenate two dynamic containers together. More...
|
|
template<typename T > |
constexpr auto | a (const std::initializer_list< T > &a) -> auto |
| Index an array literal without naming its type. More...
|
|
template<typename RandomAccessIt , typename Compare = std::less<>> |
constexpr auto | insertion_sort (const RandomAccessIt begin, const RandomAccessIt end, Compare &&compare={}) noexcept(noexcept(swap(*begin, *begin)) and noexcept(compare(*begin, *begin))) -> void |
| In-place insertion sort. As is usual, it is stable. Provides as a guarantee that it will perform no moves on sorted input. More...
|
|
template<typename RandomAccessIt , typename RandomAccessIt2 , typename Compare = std::less<>> |
constexpr auto | insertion_sort_copy (const RandomAccessIt begin, const RandomAccessIt end, const RandomAccessIt2 d_begin, const RandomAccessIt2 d_end, Compare &&compare={}) noexcept(noexcept(detail_algorithm::shift_backward(d_begin, d_begin, d_end)) and noexcept(*d_begin= *begin)) -> void |
| Out-of-place insertion sort, which does not modify the input. Provides as a guarantee that it will perform no moves on sorted input. More...
|
|
template<typename RandomAccessIt , typename RandomAccessIt2 , typename Compare = std::less<>> |
constexpr auto | adaptive_insertion_sort_copy (const RandomAccessIt begin, const RandomAccessIt end, const RandomAccessIt2 d_begin, const RandomAccessIt2 d_end, Compare &&compare={}) noexcept(noexcept(detail_algorithm::shift_backward(d_begin, d_begin, d_end)) and noexcept(*d_begin= *begin)) -> void |
| An adaptive sort which, at the cost of some additional work (time complexity Θ(sqrt(n))), avoids quadratic behavior for reverse-sorted inputs (and, in fact, handles them in optimal time). It's still possible to fool it, but it requires a staggered input, which is a highly unlikely shape for random data. More...
|
|
template<typename T > |
constexpr auto | byte_count (T) noexcept -> enable_if_t< std::is_integral< T >::value, std::size_t > |
|
template<typename T > |
constexpr auto | byte_count (T *) noexcept -> std::size_t |
|
template<typename T > |
constexpr auto | byte_count (const std::unique_ptr< T > &) noexcept -> std::size_t |
|
template<typename T > |
constexpr auto | byte_count (const T &x) noexcept -> enable_if_t< is_linear_container_v< T > and(std::is_integral< typename T::value_type >::value or is_byte_v< T >) and sizeof(typename T::value_type)==1, std::size_t > |
|
constexpr auto | byte_count (...) -> void=delete |
|
template<typename T > |
constexpr auto | get_byte_index (T x, std::size_t idx) noexcept -> enable_if_t< std::is_integral< T >::value, unsigned char > |
|
template<typename T > |
constexpr auto | get_byte_index (const T &x, std::size_t idx) noexcept -> enable_if_t< std::is_enum< T >::value, unsigned char > |
|
template<typename T > |
auto | get_byte_index (T *x, std::size_t idx) noexcept -> unsigned char |
|
template<typename T > |
auto | get_byte_index (const std::unique_ptr< T > &x, std::size_t idx) noexcept -> unsigned char |
|
template<typename RandomAccessIt , typename UnaryOperation , typename BinaryPredicate > |
constexpr auto | sort_transform (RandomAccessIt begin, RandomAccessIt end, UnaryOperation &&transform, BinaryPredicate &&compare) -> void |
| Sorts a range after applying a transformation. More...
|
|
template<typename RandomAccessIt , typename UnaryOperation > |
constexpr auto | sort_transform (RandomAccessIt begin, RandomAccessIt end, UnaryOperation &&transform) -> void |
|
template<typename RandomAccessIt , typename BinaryPredicate > |
constexpr auto | sort (RandomAccessIt begin, RandomAccessIt end, BinaryPredicate &&compare) -> void |
| Sorts a range. More...
|
|
template<typename RandomAccessIt > |
constexpr auto | sort (RandomAccessIt begin, RandomAccessIt end) -> void |
|
template<typename T , typename U > |
constexpr auto | div (T num, U den) noexcept -> decltype(std::div(num, den)) |
|
template<typename U > |
constexpr auto | calc_fib_size () noexcept -> std::size_t |
| Calculate the index of the largest fibonacci number that can be represented by a given unsigned integral type. More...
|
|
template<typename U , std::size_t N = calc_fib_size<U>() + 1> |
constexpr auto | make_fib_arr () noexcept -> trivial_array< U, N > |
| Generates the first N values of the fibonacci sequence. More...
|
|
template<typename U = std::uintmax_t> |
constexpr auto | fibonacci (int n) noexcept -> U |
| Compile-time table fibonacci function. More...
|
|
template<typename T = double> |
constexpr auto | pi () -> T |
|
template<typename T = double> |
constexpr auto | tau () -> T |
|
template<typename T = double> |
constexpr auto | e () -> T |
|
template<typename T = double> |
constexpr auto | root_2 () -> T |
|
template<typename T = double> |
constexpr auto | phi () -> T |
|
template<typename A , typename F > |
constexpr auto | saturating_cast (F x) noexcept -> enable_if_t< std::is_integral< A >::value and std::is_integral< F >::value and std::is_unsigned< A >::value, A > |
|
template<typename T , typename F > |
constexpr auto | quantize_step (F low, F delta, F val) noexcept -> T |
| Quantize a real-valued value into a discrete integer. More...
|
|
template<typename T , typename F > |
constexpr auto | quantize_range (F low, F high, F val) noexcept -> T |
| Quantize a real-valued value into a discrete integer. More...
|
|
template<typename Str > |
constexpr auto | strsize (Str &&str) -> std::size_t |
| Determines the size in characters of any valid argument to concat or append. More...
|
|
template<typename CharT > |
constexpr auto | length (const CharT *str) noexcept -> std::size_t |
|
template<typename string , typename F , typename... S> |
constexpr auto | append (string &&out, F &&f, S &&... tail) -> void |
| Given an object out of resizable stringlike type string, appends all other arguments to it. More...
|
|
template<typename string = std::string, typename F , typename... S> |
constexpr auto | concat (F &&f, S &&... ins) -> string |
| Returns a string consisting of the concatenation of all arguments. More...
|
|
template<typename string = std::string, typename str > |
constexpr auto | concat (std::initializer_list< str > ins) -> string |
| Returns a string consisting of the concatenation of all elements of an initializer list. More...
|
|
constexpr auto | isspace (char c) -> bool |
|
constexpr auto | isspace (wchar_t c) -> bool |
|
constexpr auto | isAspace (char c) -> bool |
|
constexpr auto | isAspace (wchar_t c) -> bool |
|
template<typename range , typename string = std::string> |
constexpr auto | join (const range &in, const string &joiner="") |
| Concatenates all elements of a range together with an optional joiner. More...
|
|
template<typename Container = std::vector<std::string>, typename Predicate , typename String > |
constexpr auto | split_tokens (const String &in, Predicate spacer) -> return_assert_t< is_callable< Predicate, typename Container::value_type::value_type >::value, Container > |
| Split a string on all condensed delimiters. More...
|
|
template<typename Container = std::vector<std::string>, typename String > |
constexpr auto | split_tokens (const String &in) -> Container |
| Split a string on all instances of whitespace. More...
|
|
template<typename Container = std::vector<std::string>, typename String > |
constexpr auto | split_tokens (const String &in, typename Container::value_type::value_type delim) -> Container |
| Split a string on all instances of a delimiter. More...
|
|
template<typename Container = std::vector<std::string>, typename String > |
constexpr auto | kbsplit2 (const String &in, char delim=' ') -> Container |
|
template<typename Container = std::vector<std::string>, typename String > |
constexpr auto | split_dsv (const String &str, char delim) -> Container |
| Split a string on all instances of delim. More...
|
|
template<typename Container = std::vector<std::string>, typename String , typename Predicate > |
constexpr auto | split_dsv (const String &str, Predicate delim) -> return_assert_t< is_callable< Predicate, typename Container::value_type::value_type >::value, Container > |
| Split a string on all instances of delim. More...
|
|
template<typename string > |
constexpr auto | reverse_str (string val) -> string |
| Reverses all the elements of its input. More...
|
|
template<typename string > |
constexpr auto | tolower (string str) -> string |
| Folds all characters in a string using the default execution character set to lowercase. More...
|
|
template<typename string > |
constexpr auto | toupper (string str) -> string |
| Folds all characters in a string using the default execution character set to uppercase. More...
|
|
template<typename string > |
constexpr auto | repeat (string val, std::size_t count) -> string |
| Construct a string consisting of count copies of val concatenated together. More...
|
|
constexpr auto | repeat (char val, std::size_t count) -> std::string |
| Construct a string consisting of count copies of val. More...
|
|
constexpr auto | ends_with (std::string_view haystack, std::string_view needle) -> bool |
| Checks if a given string ends with a particular string. More...
|
|
constexpr auto | ends_with (std::string_view haystack, char needle) -> bool |
| Checks if a given string ends with a particular string. More...
|
|
constexpr auto | starts_with (std::string_view haystack, std::string_view needle) -> bool |
| Checks if a given string starts with a particular string. More...
|
|
constexpr auto | starts_with (std::string_view haystack, char needle) -> bool |
| Checks if a given string starts with a particular string. More...
|
|
template<int trim, typename T , int N, typename Indices = std::make_integer_sequence<int, N - trim>> |
constexpr auto | trim_array (const T(&arr)[N]) -> std::array< T, N - trim > |
| Truncates the last trim elements from an array. More...
|
|
template<int N, typename Indices = std::make_integer_sequence<int, N - 1>> |
constexpr auto | remove_null_terminator (const char(&arr)[N]) -> std::array< char, N - 1 > |
| Creates an array of only the meaningful characters in a string literal, and not the null terminator. More...
|
|
template<typename T , typename F > |
auto | byte_cast (F v) noexcept -> T |
| Creates a T with the same object representation as the given F. More...
|
|
template<typename C , typename std::enable_if< has_reserve_v< C >, int >::type = 0> |
auto | try_reserve (C &c, std::size_t s) noexcept(noexcept(c.reserve(s))) -> void |
| Attempt to reserve capacity in a container. No-op if unsupported. More...
|
|
template<typename To , typename... Ts> |
auto | coerce (const std::variant< Ts... > &v) -> To |
| Lexically converts the value of v (no matter its type) to type To. More...
|
|
template<typename To , typename... Ts> |
auto | static_coerce (const std::variant< Ts... > &v) -> To |
| static_casts the value of v (no matter its type) to type To. More...
|
|
template<typename To , typename... Ts> |
auto | lexical_coerce (const std::variant< Ts... > &v) -> To |
| Lexically converts the value of v (no matter its type) to type To. More...
|
|
template<typename... Ts> |
| visitor (Ts...) -> visitor< Ts... > |
|
template<char... Cs> |
constexpr auto | operator""_vi () |
|
template<typename Variant , typename... Fs> |
constexpr auto | visit_indexed (Variant &&variant, Fs &&... fs) -> decltype(auto) |
| Visit a variant, but pass the index (as an integral_constant) to the visitor. This allows for a visitor of a variant with duplicated types to maintain index information. More...
|
|
template<typename To , typename From > |
constexpr auto | variant_cast (From &&v) -> To |
| Promotes an input variant to a super-variant. That is, one which provides at least the same set of types. More...
|
|
template<typename V , typename F , typename... Fs> |
constexpr auto | visit (V &&v, F &&f, Fs &&... fs) -> decltype(auto) |
| Wraps std::visit to provide an interface taking one variant and any number of functors providing an overload set. More...
|
|
template<typename V , typename F , typename... Fs> |
constexpr auto | visit2 (V &&v, F &&f, Fs &&... fs) -> decltype(auto) |
|
template<typename V , typename F , typename... Fs> |
constexpr auto | visit2_nop (V &&v, F &&f, Fs &&... fs) -> void |
|
template<typename V > |
constexpr auto | visit (V &v) -> auto |
| Two-step visiting interface. Takes a variant, and returns an object which can be called with any number of callable arguments, builds an overload set from them, and visits the variant. More...
|
|