|
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryOperation = std::plus<T>> |
OutputIterator | exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, BinaryOperation binary_op=BinaryOperation()) |
| Computes an exclusive prefix sum operation using binary_op the range [first, last), using init as the initial value, and writes the results to the range beginning at result.
|
|
template<typename ForwardIterator , typename Comparator > |
ForwardIterator | is_sorted_until_cmp (ForwardIterator first, ForwardIterator last, Comparator cmp) |
| Checks if a range is sorted using a three-way Comparator (with memcmp() semantics).
|
|
template<typename ForwardIterator , typename Comparator > |
bool | is_sorted_cmp (ForwardIterator first, ForwardIterator last, Comparator cmp) |
| Checks if a range is sorted using a three-way Comparator (with memcmp() semantics).
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator > |
OutputIterator | merge_advance_usual (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp) |
| Merge routine being able to merge only the max_size smallest elements.
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator > |
OutputIterator | merge_advance_movc (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp) |
| Merge routine being able to merge only the max_size smallest elements.
|
|
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 , typename OutputIterator , typename DiffType , typename Comparator > |
OutputIterator | merge_advance (RandomAccessIterator1 &begin1, RandomAccessIterator1 end1, RandomAccessIterator2 &begin2, RandomAccessIterator2 end2, OutputIterator target, DiffType max_size, Comparator comp) |
| Merge routine being able to merge only the max_size smallest elements.
|
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Comparator , typename Combine = std::plus< typename std::iterator_traits<InputIterator1>::value_type>> |
OutputIterator | merge_combine (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Comparator cmp=Comparator(), Combine combine=Combine()) |
| Merge two sorted ranges and add all items comparing equal.
|
|
template<typename RanSeqs , typename RankType , typename RankIterator , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RanSeqs> ::value_type::first_type>::value_type>> |
void | multisequence_partition (const RanSeqs &begin_seqs, const RanSeqs &end_seqs, const RankType &rank, RankIterator begin_offsets, Comparator comp=Comparator()) |
| Splits several sorted sequences at a certain global rank, resulting in a splitting point for each sequence.
|
|
template<typename ValueType , typename RanSeqs , typename RankType , typename Comparator = std::less<ValueType>> |
ValueType | multisequence_selection (const RanSeqs &begin_seqs, const RanSeqs &end_seqs, const RankType &rank, RankType &offset, Comparator comp=Comparator()) |
| Selects the element at a certain global rank from several sorted sequences.
|
|
template<bool Stable, bool Sentinels, typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | multiway_merge_base (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Sequential multi-way merging switch.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Sequential multi-way merge.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Stable sequential multi-way merge.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Sequential multi-way merge with sentinels in sequences.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT) |
| Stable sequential multi-way merge with sentinels in sequences.
|
|
template<bool Stable, typename RandomAccessIteratorIterator , typename Comparator > |
void | multiway_merge_sampling_splitting (const RandomAccessIteratorIterator &seqs_begin, const RandomAccessIteratorIterator &seqs_end, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type total_size, Comparator comp, std::vector< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type > *chunks, const size_t num_threads, const size_t merge_oversampling) |
| Splitting method for parallel multi-way merge routine: use sampling and binary search for in-exact splitting.
|
|
template<bool Stable, typename RandomAccessIteratorIterator , typename Comparator > |
void | multiway_merge_exact_splitting (const RandomAccessIteratorIterator &seqs_begin, const RandomAccessIteratorIterator &seqs_end, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type total_size, Comparator comp, std::vector< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type > *chunks, const size_t num_threads) |
| Splitting method for parallel multi-way merge routine: use multisequence selection for exact splitting.
|
|
template<bool Stable, typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | parallel_multiway_merge_base (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Parallel multi-way merge routine.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | parallel_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Parallel multi-way merge routine.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_parallel_multiway_merge (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Stable parallel multi-way merge routine.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | parallel_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Parallel multi-way merge routine with sentinels.
|
|
template<typename RandomAccessIteratorIterator , typename RandomAccessIterator3 , typename Comparator = std::less< typename std::iterator_traits< typename std::iterator_traits<RandomAccessIteratorIterator> ::value_type::first_type>::value_type>> |
RandomAccessIterator3 | stable_parallel_multiway_merge_sentinels (RandomAccessIteratorIterator seqs_begin, RandomAccessIteratorIterator seqs_end, RandomAccessIterator3 target, const typename std::iterator_traits< typename std::iterator_traits< RandomAccessIteratorIterator >::value_type::first_type >::difference_type size, Comparator comp=Comparator(), MultiwayMergeAlgorithm mwma=MWMA_ALGORITHM_DEFAULT, MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT, size_t num_threads=std::thread::hardware_concurrency()) |
| Stable parallel multi-way merge routine with sentinels.
|
|
template<typename RandomAccessIt , typename RandomBits > |
void | random_bipartition_shuffle (RandomAccessIt begin, RandomAccessIt end, size_t size_left_partition, RandomBits &urng) |
| Similar to std::shuffle, but only generates a random bi-partition.
|
|
template<typename DataType , unsigned Radix = 8, typename KeyExtract = void> |
auto | make_radix_heap (KeyExtract &&key_extract) -> RadixHeap< DataType, KeyExtract, decltype(key_extract(std::declval< DataType >())), Radix > |
| Helper to easily derive type of RadixHeap for a pre-C++17 compiler.
|
|
template<typename Tree , typename Compare > |
bool | splay_check (const Tree *t, const Tree *&out_tmin, const Tree *&out_tmax, const Compare &cmp) |
| check the tree order, recursively calculate min and max elements
|
|
template<typename Tree , typename Compare > |
bool | splay_check (const Tree *t, const Compare &cmp) |
| check the tree order
|
|
template<typename Key , typename Tree , typename Compare > |
Tree * | splay (const Key &k, Tree *t, const Compare &cmp) |
| Splay using the key i (which may or may not be in the tree.) The starting root is t, and the tree used is defined by rat size fields are maintained.
|
|
template<typename Tree , typename Compare > |
Tree * | splay_insert (Tree *nn, Tree *t, const Compare &cmp) |
| Insert key i into the tree t, if it is not already there.
|
|
template<typename Key , typename Tree , typename Compare > |
Tree * | splay_erase (const Key &k, Tree *&t, const Compare &cmp) |
| Erases i from the tree if it's there.
|
|
template<typename Tree , typename Functor > |
void | splay_traverse_preorder (const Functor &f, const Tree *t) |
| traverse the tree in preorder (left, node, right)
|
|
template<typename Tree , typename Functor > |
void | splay_traverse_postorder (const Functor &f, Tree *t) |
| traverse the tree in postorder (left, right, node)
|
|
static bool | operator== (const StringView &a, const std::string &b) noexcept |
| equality operator to compare a StringView with a std::string
|
|
static bool | operator== (const std::string &a, const StringView &b) noexcept |
| equality operator to compare a StringView with a std::string
|
|
static bool | operator!= (const StringView &a, const std::string &b) noexcept |
| inequality operator to compare a StringView with a std::string
|
|
static bool | operator!= (const std::string &a, const StringView &b) noexcept |
| inequality operator to compare a StringView with a std::string
|
|
static bool | operator< (const StringView &a, const std::string &b) noexcept |
| less operator to compare a StringView with a std::string lexicographically
|
|
static bool | operator< (const std::string &a, const StringView &b) noexcept |
| less operator to compare a StringView with a std::string lexicographically
|
|
static bool | operator> (const StringView &x, const std::string &y) noexcept |
|
static bool | operator> (const std::string &x, const StringView &y) noexcept |
|
static bool | operator<= (const StringView &x, const std::string &y) noexcept |
|
static bool | operator<= (const std::string &x, const StringView &y) noexcept |
|
static bool | operator>= (const StringView &x, const std::string &y) noexcept |
|
static bool | operator>= (const std::string &x, const StringView &y) noexcept |
|
static bool | operator== (const StringView &x, const char *y) noexcept |
| equality operator to compare a StringView with a const char*
|
|
static bool | operator== (const char *x, const StringView &y) noexcept |
| equality operator to compare a StringView with a const char*
|
|
static bool | operator!= (const StringView &x, const char *y) noexcept |
| inequality operator to compare a StringView with a const char*
|
|
static bool | operator!= (const char *x, const StringView &y) noexcept |
| inequality operator to compare a StringView with a const char*
|
|
static bool | operator< (const StringView &x, const char *y) noexcept |
|
static bool | operator< (const char *x, const StringView &y) noexcept |
|
static bool | operator> (const StringView &x, const char *y) noexcept |
|
static bool | operator> (const char *x, const StringView &y) noexcept |
|
static bool | operator<= (const StringView &x, const char *y) noexcept |
|
static bool | operator<= (const char *x, const StringView &y) noexcept |
|
static bool | operator>= (const StringView &x, const char *y) noexcept |
|
static bool | operator>= (const char *x, const StringView &y) noexcept |
|
template<typename Type , typename... Args> |
CountingPtr< Type > | make_counting (Args &&... args) |
| method analogous to std::make_shared and std::make_unique.
|
|
template<typename A , typename D > |
void | swap (CountingPtr< A, D > &a1, CountingPtr< A, D > &a2) noexcept |
| swap enclosed object with another counting pointer (no reference counts need change)
|
|
template<typename A , typename D > |
std::ostream & | operator<< (std::ostream &os, const CountingPtr< A, D > &c) |
| print pointer
|
|
template<class C , typename R , typename... A> |
Delegate< R(A...)> | make_delegate (C *const object_ptr, R(C::*const method_ptr)(A...)) noexcept |
| constructor for wrapping a class::method with object pointer.
|
|
template<class C , typename R , typename... A> |
Delegate< R(A...)> | make_delegate (C &object_ptr, R(C::*const method_ptr)(A...)) noexcept |
| constructor for wrapping a class::method with object reference.
|
|
template<class C , typename R , typename... A> |
Delegate< R(A...)> | make_delegate (C const &object_ptr, R(C::*const method_ptr)(A...) const) noexcept |
| constructor for wrapping a const class::method with object reference.
|
|
void | die_with_message (const std::string &msg) |
| die with message - either throw an exception or die via std::terminate()
|
|
void | die_with_message (const char *msg, const char *file, size_t line) |
| die with message - either throw an exception or die via std::terminate()
|
|
void | die_with_message (const std::string &msg, const char *file, size_t line) |
| die with message - either throw an exception or die via std::terminate()
|
|
bool | set_die_with_exception (bool b) |
| Switch between dying via std::terminate() and throwing an exception.
|
|
template<typename TypeA , typename TypeB > |
bool | die_equal_compare (TypeA a, TypeB b) |
| helper method to compare two values in die_unequal()
|
|
template<> |
bool | die_equal_compare (const char *a, const char *b) |
|
template<> |
bool | die_equal_compare (float a, float b) |
|
template<> |
bool | die_equal_compare (double a, double b) |
|
template<typename Type > |
Type | die_unequal_eps_abs (const Type &t) |
| simple replacement for std::abs
|
|
template<typename TypeA , typename TypeB > |
bool | die_equal_eps_compare (TypeA x, TypeB y, double eps) |
| helper method to compare two values in die_unequal_eps()
|
|
std::string | md5_hex (const void *data, std::uint32_t size) |
| process data and return 16 byte (128 bit) digest hex encoded
|
|
std::string | md5_hex (const std::string &str) |
| process data and return 16 byte (128 bit) digest hex encoded
|
|
std::string | md5_hex_uc (const void *data, std::uint32_t size) |
| process data and return 16 byte (128 bit) digest upper-case hex encoded
|
|
std::string | md5_hex_uc (const std::string &str) |
| process data and return 16 byte (128 bit) digest upper-case hex encoded
|
|
std::string | sha1_hex (const void *data, std::uint32_t size) |
| process data and return 20 byte (160 bit) digest hex encoded
|
|
std::string | sha1_hex (const std::string &str) |
| process data and return 20 byte (160 bit) digest hex encoded
|
|
std::string | sha1_hex_uc (const void *data, std::uint32_t size) |
| process data and return 20 byte (160 bit) digest upper-case hex encoded
|
|
std::string | sha1_hex_uc (const std::string &str) |
| process data and return 20 byte (160 bit) digest upper-case hex encoded
|
|
std::string | sha256_hex (const void *data, std::uint32_t size) |
| process data and return 32 byte (256 bit) digest hex encoded
|
|
std::string | sha256_hex (const std::string &str) |
| process data and return 32 byte (256 bit) digest hex encoded
|
|
std::string | sha256_hex_uc (const void *data, std::uint32_t size) |
| process data and return 32 byte (256 bit) digest upper-case hex encoded
|
|
std::string | sha256_hex_uc (const std::string &str) |
| process data and return 32 byte (256 bit) digest upper-case hex encoded
|
|
std::string | sha512_hex (const void *data, std::uint32_t size) |
| process data and return 64 byte (512 bit) digest hex encoded
|
|
std::string | sha512_hex (const std::string &str) |
| process data and return 64 byte (512 bit) digest hex encoded
|
|
std::string | sha512_hex_uc (const void *data, std::uint32_t size) |
| process data and return 64 byte (512 bit) digest upper-case hex encoded
|
|
std::string | sha512_hex_uc (const std::string &str) |
| process data and return 64 byte (512 bit) digest upper-case hex encoded
|
|
LoggerOutputHook * | set_logger_output_hook (LoggerOutputHook *hook) |
| set new LoggerOutputHook instance to receive global log lines.
|
|
LoggerOutputHook * | set_logger_to_stderr () |
| install default logger to cerr / stderr instead of stdout.
|
|
LoggerPrefixHook * | set_logger_prefix_hook (LoggerPrefixHook *hook) |
| Set new LoggerPrefixHook instance to prefix global log lines.
|
|
template<typename Type > |
enable_if<!has_ostream_operator< Type >::value, constchar * >::type | wrap_unprintable (Type, const char *instead="<unprintable>") |
| SFINAE magic to return "<unprintable>" instead if the value HAS NO ostream operator << available.
|
|
template<typename Type > |
enable_if< has_ostream_operator< Type >::value, Type >::type | wrap_unprintable (Type value, const char *=nullptr) |
| SFINAE magic to return the value if the value HAS a ostream operator << available.
|
|
template<typename Type > |
enable_if<!has_ostream_operator< Type >::value, constchar * >::type | wrap_unp (Type, const char *instead="<unprintable>") |
| SFINAE magic to return "<unprintable>" instead if the value HAS NO ostream operator << available.
|
|
template<typename Type > |
enable_if< has_ostream_operator< Type >::value, Type >::type | wrap_unp (Type value, const char *=nullptr) |
| SFINAE magic to return the value if the value HAS a ostream operator << available.
|
|
template<typename T > |
T | abs_diff (const T &a, const T &b) |
| absolute difference, which also works for unsigned types
|
|
static std::uint16_t | bswap16_generic (const std::uint16_t &x) |
| bswap16 - generic implementation
|
|
static std::uint16_t | bswap16 (const std::uint16_t &v) |
| bswap16 - generic
|
|
static std::uint32_t | bswap32_generic (const std::uint32_t &x) |
| bswap32 - generic implementation
|
|
static std::uint32_t | bswap32 (const std::uint32_t &v) |
| bswap32 - generic
|
|
static std::uint64_t | bswap64_generic (const std::uint64_t &x) |
| bswap64 - generic implementation
|
|
static std::uint64_t | bswap64 (const std::uint64_t &v) |
| bswap64 - generic
|
|
template<typename Integral > |
static unsigned | clz_template (Integral x) |
| clz (count leading zeros) - generic implementation
|
|
template<typename Integral > |
unsigned | clz (Integral x) |
|
template<> |
unsigned | clz< int > (int i) |
| clz (count leading zeros)
|
|
template<> |
unsigned | clz< unsigned > (unsigned i) |
| clz (count leading zeros)
|
|
template<> |
unsigned | clz< long > (long i) |
| clz (count leading zeros)
|
|
template<> |
unsigned | clz< unsigned long > (unsigned long i) |
| clz (count leading zeros)
|
|
template<> |
unsigned | clz< long long > (long long i) |
| clz (count leading zeros)
|
|
template<> |
unsigned | clz< unsigned long long > (unsigned long long i) |
| clz (count leading zeros)
|
|
template<typename Integral > |
static unsigned | ctz_template (Integral x) |
| ctz (count trailing zeros) - generic implementation
|
|
template<typename Integral > |
unsigned | ctz (Integral x) |
|
template<> |
unsigned | ctz< int > (int i) |
| ctz (count trailing zeros)
|
|
template<> |
unsigned | ctz< unsigned > (unsigned i) |
| ctz (count trailing zeros)
|
|
template<> |
unsigned | ctz< long > (long i) |
| ctz (count trailing zeros)
|
|
template<> |
unsigned | ctz< unsigned long > (unsigned long i) |
| ctz (count trailing zeros)
|
|
template<> |
unsigned | ctz< long long > (long long i) |
| ctz (count trailing zeros)
|
|
template<> |
unsigned | ctz< unsigned long long > (unsigned long long i) |
| ctz (count trailing zeros)
|
|
template<typename IntegralN , typename IntegralK > |
static constexpr auto | div_ceil (const IntegralN &n, const IntegralK &k) -> decltype(n+k) |
| calculate n div k with rounding up, for n and k positive!
|
|
template<typename Integral > |
static unsigned | ffs_template (Integral x) |
| ffs (find first set bit) - generic implementation
|
|
static unsigned | ffs (int i) |
| find first set bit in integer, or zero if none are set.
|
|
static unsigned | ffs (unsigned int i) |
| find first set bit in integer, or zero if none are set.
|
|
static unsigned | ffs (long i) |
| find first set bit in integer, or zero if none are set.
|
|
static unsigned | ffs (unsigned long i) |
| find first set bit in integer, or zero if none are set.
|
|
static unsigned | ffs (long long i) |
| find first set bit in integer, or zero if none are set.
|
|
static unsigned | ffs (unsigned long long i) |
| find first set bit in integer, or zero if none are set.
|
|
template<typename IntegerType > |
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor_template (IntegerType i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor (int i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor (unsigned int i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor (long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor (unsigned long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor (long long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_floor (unsigned long long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_ceil (int i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_ceil (unsigned int i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_ceil (long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_ceil (unsigned long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_ceil (long long i) |
| calculate the log2 floor of an integer type
|
|
static TLX_ADVANCED_CONSTEXPR unsigned | integer_log2_ceil (unsigned long long i) |
| calculate the log2 floor of an integer type
|
|
template<typename Integral > |
static bool | is_power_of_two_template (Integral i) |
|
static bool | is_power_of_two (int i) |
| does what it says: true if i is a power of two
|
|
static bool | is_power_of_two (unsigned int i) |
| does what it says: true if i is a power of two
|
|
static bool | is_power_of_two (long i) |
| does what it says: true if i is a power of two
|
|
static bool | is_power_of_two (unsigned long i) |
| does what it says: true if i is a power of two
|
|
static bool | is_power_of_two (long long i) |
| does what it says: true if i is a power of two
|
|
static bool | is_power_of_two (unsigned long long i) |
| does what it says: true if i is a power of two
|
|
static unsigned | popcount_generic8 (std::uint8_t x) |
| popcount (count one bits) - generic SWAR implementation
|
|
static unsigned | popcount_generic16 (std::uint16_t x) |
| popcount (count one bits) - generic SWAR implementation
|
|
static unsigned | popcount_generic32 (std::uint32_t x) |
| popcount (count one bits) - generic SWAR implementation from https://stackoverflow.com/questions/109023
|
|
static unsigned | popcount_generic64 (std::uint64_t x) |
| popcount (count one bits) - generic SWAR implementation
|
|
template<typename Integral > |
unsigned | popcount (Integral i) |
| popcount (count one bits)
|
|
static size_t | popcount (const void *data, size_t size) |
|
template<unsigned D, typename T > |
static constexpr T | power_to_the (T x) |
| power_to_the<D>(x)
|
|
static std::uint32_t | rol32_generic (const std::uint32_t &x, int i) |
| rol32 - generic implementation
|
|
static std::uint32_t | rol32 (const std::uint32_t &x, int i) |
| rol32 - generic
|
|
static std::uint64_t | rol64_generic (const std::uint64_t &x, int i) |
| rol64 - generic implementation
|
|
static std::uint64_t | rol64 (const std::uint64_t &x, int i) |
| rol64 - generic
|
|
static std::uint32_t | ror32_generic (const std::uint32_t &x, int i) |
| ror32 - generic implementation
|
|
static std::uint32_t | ror32 (const std::uint32_t &x, int i) |
| ror32 - generic
|
|
static std::uint64_t | ror64_generic (const std::uint64_t &x, int i) |
| ror64 - generic implementation
|
|
static std::uint64_t | ror64 (const std::uint64_t &x, int i) |
| ror64 - generic
|
|
template<typename Integral > |
static Integral | round_up_to_power_of_two_template (Integral n) |
|
static int | round_up_to_power_of_two (int i) |
| does what it says: round up to next power of two
|
|
static unsigned int | round_up_to_power_of_two (unsigned int i) |
| does what it says: round up to next power of two
|
|
static long | round_up_to_power_of_two (long i) |
| does what it says: round up to next power of two
|
|
static unsigned long | round_up_to_power_of_two (unsigned long i) |
| does what it says: round up to next power of two
|
|
static long long | round_up_to_power_of_two (long long i) |
| does what it says: round up to next power of two
|
|
static unsigned long long | round_up_to_power_of_two (unsigned long long i) |
| does what it says: round up to next power of two
|
|
static int | round_down_to_power_of_two (int i) |
| does what it says: round down to next power of two
|
|
static unsigned int | round_down_to_power_of_two (unsigned int i) |
| does what it says: round down to next power of two
|
|
static long | round_down_to_power_of_two (long i) |
| does what it says: round down to next power of two
|
|
static unsigned long | round_down_to_power_of_two (unsigned long i) |
| does what it says: round down to next power of two
|
|
static long long | round_down_to_power_of_two (long long i) |
| does what it says: round down to next power of two
|
|
static unsigned long long | round_down_to_power_of_two (unsigned long long i) |
| does what it says: round down to next power of two
|
|
template<typename IntegralN , typename IntegralK > |
static constexpr auto | round_up (const IntegralN &n, const IntegralK &k) -> decltype(n+k) |
| round n up to the next multiple of k, for n and k positive!
|
|
template<typename T > |
int | sgn (const T &val) |
| sgn() - signum
|
|
template<typename Functor , typename Tuple > |
auto | apply_tuple (Functor &&f, Tuple &&t) |
| Call the functor f with the contents of t as arguments.
|
|
template<size_t Size, typename Functor > |
void | call_for_range (Functor &&f) |
| Call a generic functor (like a generic lambda) for the integers [0,Size).
|
|
template<size_t Begin, size_t End, typename Functor > |
void | call_for_range (Functor &&f) |
| Call a generic functor (like a generic lambda) for the integers [Begin,End).
|
|
template<typename Functor , typename... Args> |
void | call_foreach (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument.
|
|
template<typename Functor , typename Tuple > |
void | call_foreach_tuple (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) to each components of a tuple together with its zero-based index.
|
|
template<typename Functor , typename Tuple > |
void | call_foreach_tuple_with_index (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) to each components of a tuple together with its zero-based index.
|
|
template<typename Functor , typename... Args> |
void | call_foreach_with_index (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument together with its zero-based index.
|
|
template<typename Reduce , typename Initial , typename... Args> |
auto | fold_left (Reduce &&r, Initial &&init, Args &&... args) |
| Implements fold_left() – ((a * b) * c) – with a binary Reduce operation and initial value.
|
|
template<typename Reduce , typename Initial , typename Tuple > |
auto | fold_left_tuple (Reduce &&r, Initial &&init, Tuple &&t) |
| Implements fold_left() – ((a * b) * c) – with a binary Reduce operation and initial value on a tuple.
|
|
template<typename Reduce , typename Initial , typename... Args> |
auto | fold_right (Reduce &&r, Initial &&init, Args &&... args) |
| Implements fold_right() – (a * (b * c)) – with a binary Reduce operation and initial value.
|
|
template<typename Reduce , typename Initial , typename Tuple > |
auto | fold_right_tuple (Reduce &&r, Initial &&init, Tuple &&t) |
| Implements fold_right() – (a * (b * c)) – with a binary Reduce operation and initial value on a tuple.
|
|
template<typename Functor > |
static auto | make_function_chain (const Functor &functor) |
| Functor chain maker. Can also be called with a lambda function.
|
|
static auto | make_function_chain () |
| Construct and empty function chain.
|
|
template<typename Input , typename Functor > |
static auto | make_function_stack (const Functor &functor) |
| Function-style construction of a FunctionStack.
|
|
template<typename... Types> |
void | vexpand (Types &&...) |
|
template<size_t Size, typename Functor > |
auto | vmap_for_range (Functor &&f) |
| Vmap a generic functor (like a generic lambda) for the integers [0,Size).
|
|
template<size_t Begin, size_t End, typename Functor > |
auto | vmap_for_range (Functor &&f) |
| Vmap a generic functor (like a generic lambda) for the integers [Begin,End).
|
|
template<typename Functor , typename... Args> |
auto | vmap_foreach (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument.
|
|
template<typename Functor , typename Tuple > |
auto | vmap_foreach_tuple (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) for each variadic template argument and collect the result in a std::tuple<>.
|
|
template<typename Functor , typename Tuple > |
auto | vmap_foreach_tuple_with_index (Functor &&f, Tuple &&t) |
| Call a generic functor (like a generic lambda) for each variadic template argument and collect the result in a std::tuple<>.
|
|
template<typename Functor , typename... Args> |
auto | vmap_foreach_with_index (Functor &&f, Args &&... args) |
| Call a generic functor (like a generic lambda) for each variadic template argument together with its zero-based index.
|
|
int | setenv (const char *name, const char *value, int overwrite) |
| setenv - change or add an environment variable.
|
|
static std::uint64_t | siphash_plain (const std::uint8_t key[16], const std::uint8_t *m, size_t len) |
|
static std::uint64_t | siphash (const std::uint8_t key[16], const std::uint8_t *msg, size_t size) |
|
static std::uint64_t | siphash (const std::uint8_t *msg, size_t size) |
|
static std::uint64_t | siphash (const char *msg, size_t size) |
|
static std::uint64_t | siphash (const std::string &str) |
|
template<typename Type > |
static std::uint64_t | siphash (const Type &value) |
|
std::istream & | appendline (std::istream &is, std::string &str, char delim='\n') |
| like std::getline(istream, string, delim) except that it appends to the string, possibly reusing buffer capacity.
|
|
int | compare_icase (const char *a, const char *b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case
|
|
int | compare_icase (const char *a, const std::string &b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case
|
|
int | compare_icase (const std::string &a, const char *b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case
|
|
int | compare_icase (const std::string &a, const std::string &b) |
| returns +1/0/-1 like strcmp(a, b) but without regard for letter case
|
|
bool | contains (const std::string &str, const std::string &pattern) |
| Tests of string contains pattern.
|
|
bool | contains (const std::string &str, const char *pattern) |
| Tests of string contains pattern.
|
|
bool | contains (const std::string &str, const char ch) |
| Tests of string contains character.
|
|
static bool | is_white (char c) |
|
bool | contains_word (const std::string &str, const char *word) |
| Search the given string for a whitespace-delimited word.
|
|
bool | contains_word (const std::string &str, const std::string &word) |
| Search the given string for a whitespace-delimited word.
|
|
bool | ends_with (const char *str, const char *match) |
| Checks if the given match string is located at the end of this string.
|
|
bool | ends_with (const char *str, const std::string &match) |
| Checks if the given match string is located at the end of this string.
|
|
bool | ends_with (const std::string &str, const char *match) |
| Checks if the given match string is located at the end of this string.
|
|
bool | ends_with (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the end of this string.
|
|
bool | ends_with_icase (const char *str, const char *match) |
|
bool | ends_with_icase (const char *str, const std::string &match) |
|
bool | ends_with_icase (const std::string &str, const char *match) |
|
bool | ends_with_icase (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the end of this string.
|
|
bool | equal_icase (const char *a, const char *b) |
| returns true if a == b without regard for letter case
|
|
bool | equal_icase (const char *a, const std::string &b) |
| returns true if a == b without regard for letter case
|
|
bool | equal_icase (const std::string &a, const char *b) |
| returns true if a == b without regard for letter case
|
|
bool | equal_icase (const std::string &a, const std::string &b) |
| returns true if a == b without regard for letter case
|
|
std::string & | erase_all (std::string *str, char drop=' ') |
| Remove all occurrences of the given character in-place.
|
|
std::string & | erase_all (std::string *str, const char *drop) |
| Remove all occurrences of the given characters in-place.
|
|
std::string & | erase_all (std::string *str, const std::string &drop) |
| Remove all occurrences of the given characters in-place.
|
|
std::string | erase_all (const std::string &str, char drop=' ') |
| Remove all occurrences of the given character, return copy of string.
|
|
std::string | erase_all (const std::string &str, const char *drop) |
| Remove all occurrences of the given characters, return copy of string.
|
|
std::string | erase_all (const std::string &str, const std::string &drop) |
| Remove all occurrences of the given characters, return copy of string.
|
|
std::string | escape_html (const std::string &str) |
| Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities.
|
|
std::string | escape_html (const char *str) |
| Escape characters for inclusion in HTML documents: replaces the characters <, >, & and " with HTML entities.
|
|
std::string | escape_uri (const std::string &str) |
| Escape a string into a URI-encoding.
|
|
std::string | escape_uri (const char *str) |
| Escape a string into a URI-encoding.
|
|
std::string & | expand_environment_variables (std::string *s) |
| Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables.
|
|
std::string | expand_environment_variables (const std::string &s) |
| Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables.
|
|
std::string | expand_environment_variables (const char *s) |
| Expand substrings $ABC_123 and ${ABC_123} into the corresponding environment variables.
|
|
template<typename Separator1 , typename Separator2 > |
static std::string | extract_between_template (const std::string &str, const Separator1 &sep1, size_t sep1_size, const Separator2 &sep2) |
|
std::string | extract_between (const std::string &str, const char *sep1, const char *sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found.
|
|
std::string | extract_between (const std::string &str, const char *sep1, const std::string &sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found.
|
|
std::string | extract_between (const std::string &str, const std::string &sep1, const char *sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found.
|
|
std::string | extract_between (const std::string &str, const std::string &sep1, const std::string &sep2) |
| Search the string for given start and end separators and extract all characters between the both, if they are found.
|
|
std::string | format_iec_units (std::uint64_t number, int precision=3) |
| Format a byte size using IEC (Ki, Mi, Gi, Ti) suffixes (powers of two).
|
|
std::string | format_si_units (std::uint64_t number, int precision) |
| Format number as something like 1 TB.
|
|
static std::uint32_t | hash_djb2 (const unsigned char *str) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_djb2 (const char *str) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_djb2 (const unsigned char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_djb2 (const char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_djb2 (const std::string &str) |
| Simple, fast, but "insecure" string hash method by Dan Bernstein from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_sdbm (const unsigned char *str) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_sdbm (const char *str) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_sdbm (const unsigned char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_sdbm (const char *str, size_t size) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.
|
|
static std::uint32_t | hash_sdbm (const std::string &str) |
| Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.
|
|
size_t | index_of (const std::vector< std::string > &list, const char *str) |
| Attempts to find str in the list and return the index.
|
|
size_t | index_of (const std::vector< std::string > &list, const std::string &str) |
| Attempts to find str in the list and return the index.
|
|
size_t | index_of_icase (const std::vector< std::string > &list, const char *str) |
| Attempts to find str in the list and return the index using case-insensitive comparisons.
|
|
size_t | index_of_icase (const std::vector< std::string > &list, const std::string &str) |
| Attempts to find str in the list and return the index using case-insensitive comparisons.
|
|
bool | less_icase (const char *a, const char *b) |
| returns true if a < b without regard for letter case
|
|
bool | less_icase (const char *a, const std::string &b) |
| returns true if a < b without regard for letter case
|
|
bool | less_icase (const std::string &a, const char *b) |
| returns true if a < b without regard for letter case
|
|
bool | less_icase (const std::string &a, const std::string &b) |
| returns true if a < b without regard for letter case
|
|
template<typename Param > |
static size_t | levenshtein_algorithm (const char *a, size_t a_size, const char *b, size_t b_size) |
| Computes the Levenshtein string distance also called edit distance between two strings.
|
|
static size_t | levenshtein (const char *a, const char *b) |
| Computes the Levenshtein string distance between two strings.
|
|
static size_t | levenshtein_icase (const char *a, const char *b) |
| Computes the Levenshtein string distance between two strings.
|
|
static size_t | levenshtein (const std::string &a, const std::string &b) |
| Computes the Levenshtein string distance between two strings.
|
|
static size_t | levenshtein_icase (const std::string &a, const std::string &b) |
| Computes the Levenshtein string distance between two strings.
|
|
std::string | pad (const std::string &s, size_t len, char pad_char=' ') |
| Truncate or pad string to exactly len characters.
|
|
bool | parse_si_iec_units (const char *str, std::uint64_t *out_size, char default_unit=0) |
| Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes.
|
|
bool | parse_si_iec_units (const std::string &str, std::uint64_t *out_size, char default_unit=0) |
| Parse a string like "343KB" or "44 GiB" into the corresponding size in bytes.
|
|
static void | parse_uri (const char *uri, tlx::string_view *path, tlx::string_view *query_string, tlx::string_view *fragment) |
| Parse a URI like "/path1/path2?query=string&submit=submit#fragment" into the parts path, query_string, and fragment.
|
|
static void | parse_uri (const std::string &uri, tlx::string_view *path, tlx::string_view *query_string, tlx::string_view *fragment) |
| Parse a URI like "/path1/path2?query=string&submit=submit#fragment" into the parts path, query_string, and fragment.
|
|
static std::string | parse_uri_form_data_decode (const char *str, const char *end=nullptr) |
| Helper function to decode %20 and + in urlencoded form data like "query=string+with+spaces&submit=yes%21&".
|
|
static void | parse_uri_form_data (const char *query_string, std::vector< std::string > *key, std::vector< std::string > *value) |
| Parse a urlencoded form data like "query=string+with+spaces&submit=yes%21&" into a list of keys and values.
|
|
static void | parse_uri_form_data (const std::string &query_string, std::vector< std::string > *key, std::vector< std::string > *value) |
| Parse a urlencoded form data like "query=string+with+spaces&submit=yes%21&" into a list of keys and values.
|
|
static std::vector< std::string > & | split (std::vector< std::string > *into, const char *sep, size_t sep_size, const std::string &str, std::string::size_type limit) |
|
std::vector< std::string > | split_words (const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string by whitespaces into distinct words.
|
|
std::string | ssprintf (const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(1 |
| Helper for return the result of a sprintf() call inside a std::string.
|
|
std::string | ssnprintf (size_t max_size, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(2 |
| Helper for return the result of a snprintf() call inside a std::string.
|
|
template<typename String = std::string> |
String | ssprintf_generic (const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(1 |
| Helper for return the result of a sprintf() call inside a string object.
|
|
template<typename String > |
String String | ssprintf_generic (const char *fmt,...) |
|
template<typename String = std::string> |
String | ssnprintf_generic (size_t max_size, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(2 |
| Helper for return the result of a snprintf() call inside a string object.
|
|
template<typename String > |
String String | ssnprintf_generic (size_t max_size, const char *fmt,...) |
|
bool | starts_with (const char *str, const char *match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with (const char *str, const std::string &match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with (const std::string &str, const char *match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with_icase (const char *str, const char *match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with_icase (const char *str, const std::string &match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with_icase (const std::string &str, const char *match) |
| Checks if the given match string is located at the start of this string.
|
|
bool | starts_with_icase (const std::string &str, const std::string &match) |
| Checks if the given match string is located at the start of this string.
|
|
char | to_lower (char ch) |
| Transform the given character to lower case without any localization.
|
|
std::string & | to_lower (std::string *str) |
| Transforms the given string to lowercase and returns a reference to it.
|
|
std::string | to_lower (const std::string &str) |
| Returns a copy of the given string converted to lowercase.
|
|
char | to_upper (char ch) |
| Transform the given character to upper case without any localization.
|
|
std::string & | to_upper (std::string *str) |
| Transforms the given string to uppercase and returns a reference to it.
|
|
std::string | to_upper (const std::string &str) |
| Returns a copy of the given string converted to uppercase.
|
|
std::string | union_words (const std::string &wordsA, const std::string &wordsB) |
| Return union of two keyword sets.
|
|
bool | is_space (char ch) |
|
std::string | word_wrap (const std::string &str, unsigned int wrap=80) |
| Try to wrap a string to 80 columns without split words.
|
|
double | timestamp () |
| Returns number of seconds since the epoch, currently microsecond resolution.
|
|
template<typename... Types> |
void | unused (Types &&...) |
|
template<typename Type > |
void | vector_free (std::vector< Type > &v) |
| Simple method to free the underlying memory in a vector, because .clear() need not do it.
|
|
|
void | print_raw_backtrace (FILE *out, unsigned int max_frames, const char *fmt,...) TLX_ATTRIBUTE_FORMAT_PRINTF(3 |
| Print a plain hex stack backtrace of the called function to FILE* out, prefixed with the given printf formatted output.
|
|
void | print_raw_backtrace (FILE *out=stderr, unsigned int max_frames=63) |
| Print a plain hex stack backtrace of the called function to FILE* out.
|
|
void | print_cxx_backtrace (FILE *out=stderr, unsigned int max_frames=63) |
| Print a demangled stack backtrace of the caller function to FILE* out.
|
|
void | enable_segv_backtrace () |
| Install SIGSEGV signal handler and output backtrace on segmentation fault.
|
|
|
template<bool Stable, typename RandomAccessIterator , typename Comparator > |
void | parallel_mergesort_base (RandomAccessIterator begin, RandomAccessIterator end, Comparator comp, size_t num_threads=std::thread::hardware_concurrency(), MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT) |
| Parallel multiway mergesort main call.
|
|
template<typename RandomAccessIterator , typename Comparator = std::less< typename std::iterator_traits<RandomAccessIterator>::value_type>> |
void | parallel_mergesort (RandomAccessIterator begin, RandomAccessIterator end, Comparator comp=Comparator(), size_t num_threads=std::thread::hardware_concurrency(), MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT) |
| Parallel multiway mergesort.
|
|
template<typename RandomAccessIterator , typename Comparator = std::less< typename std::iterator_traits<RandomAccessIterator>::value_type>> |
void | stable_parallel_mergesort (RandomAccessIterator begin, RandomAccessIterator end, Comparator comp=Comparator(), size_t num_threads=std::thread::hardware_concurrency(), MultiwayMergeSplittingAlgorithm mwmsa=MWMSA_DEFAULT) |
| Stable parallel multiway mergesort.
|
|
|
static void | sort_strings (unsigned char **strings, size_t size, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings (char **strings, size_t size, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings (const unsigned char **strings, size_t size, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings (const char **strings, size_t size, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings (std::vector< char * > &strings, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings (std::vector< unsigned char * > &strings, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings (std::vector< const char * > &strings, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings (std::vector< const unsigned char * > &strings, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings (std::string *strings, size_t size, size_t memory=0) |
| Sort a set of std::strings in place.
|
|
static void | sort_strings (std::vector< std::string > &strings, size_t memory=0) |
| Sort a vector of std::strings in place.
|
|
static void | sort_strings_lcp (unsigned char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings_lcp (char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings_lcp (const unsigned char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings_lcp (const char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings_lcp (std::vector< char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings_lcp (std::vector< unsigned char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings_lcp (std::vector< const char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style char* in place.
|
|
static void | sort_strings_lcp (std::vector< const unsigned char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings represented by C-style uint8_t* in place.
|
|
static void | sort_strings_lcp (std::string *strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of std::strings in place.
|
|
static void | sort_strings_lcp (std::vector< std::string > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a vector of std::strings in place.
|
|
static void | sort_strings_parallel (unsigned char **strings, size_t size, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel (char **strings, size_t size, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel (const unsigned char **strings, size_t size, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel (const char **strings, size_t size, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel (std::vector< char * > &strings, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel (std::vector< unsigned char * > &strings, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel (std::vector< const char * > &strings, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel (std::vector< const unsigned char * > &strings, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel (std::string *strings, size_t size, size_t memory=0) |
| Sort a set of std::strings in place in parallel.
|
|
static void | sort_strings_parallel (std::vector< std::string > &strings, size_t memory=0) |
| Sort a vector of std::strings in place in parallel.
|
|
static void | sort_strings_parallel_lcp (unsigned char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel_lcp (char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel_lcp (const unsigned char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel_lcp (const char **strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel_lcp (std::vector< char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel_lcp (std::vector< unsigned char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel_lcp (std::vector< const char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style char* in place.
|
|
static void | sort_strings_parallel_lcp (std::vector< const unsigned char * > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of strings in parallel represented by C-style uint8_t* in place.
|
|
static void | sort_strings_parallel_lcp (std::string *strings, size_t size, std::uint32_t *lcp, size_t memory=0) |
| Sort a set of std::strings in place in parallel.
|
|
static void | sort_strings_parallel_lcp (std::vector< std::string > &strings, std::uint32_t *lcp, size_t memory=0) |
| Sort a vector of std::strings in place in parallel.
|
|
|
std::string | base64_encode (const void *data, size_t size, size_t line_break=0) |
| Encode the given binary data into base64 representation as described in RFC 2045 or RFC 3548.
|
|
std::string | base64_encode (const std::string &str, size_t line_break=0) |
| Encode the given binary string into base64 representation as described in RFC 2045 or RFC 3548.
|
|
std::string | base64_decode (const void *data, size_t size, bool strict=true) |
| Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data.
|
|
std::string | base64_decode (const std::string &str, bool strict=true) |
| Decode a string in base64 representation as described in RFC 2045 or RFC 3548 and return the original data.
|
|
|
std::string | bitdump_8_msb (const void *const data, size_t size) |
| Dump a (binary) string of 8-bit bytes as a sequence of '0' and '1' characters, with the most significant bits (msb) first.
|
|
std::string | bitdump_8_msb (const std::string &str) |
| Dump a (binary) string of 8-bit bytes as a sequence of '0' and '1' characters, with the most significant bits (msb) first.
|
|
std::string | bitdump_le8 (const void *const data, size_t size) |
| deprecated method: unclear naming and documentation.
|
|
std::string | bitdump_le8 (const std::string &str) |
| deprecated method: unclear naming and documentation.
|
|
std::string | bitdump_8_lsb (const void *const data, size_t size) |
| Dump a (binary) string of 8-bit bytes as a sequence of '0' and '1' characters, with the least significant bits (lsb) first.
|
|
std::string | bitdump_8_lsb (const std::string &str) |
| Dump a (binary) string of 8-bit bytes as a sequence of '0' and '1' characters, with the least significant bits (lsb) first.
|
|
std::string | bitdump_be8 (const void *const data, size_t size) |
| deprecated method: unclear naming and documentation.
|
|
std::string | bitdump_be8 (const std::string &str) |
| deprecated method: unclear naming and documentation.
|
|
template<typename Type > |
std::string | bitdump_8_msb_type (const Type &t) |
| Dump a (binary) item of 8-bit bytes as a sequence of '0' and '1' characters, with the most significant bits (msb) first.
|
|
template<typename Type > |
std::string | bitdump_le8_type (const Type &t) |
| deprecated method: unclear naming and documentation.
|
|
template<typename Type > |
std::string | bitdump_8_lsb_type (const Type &t) |
| Dump a (binary) item of 8-bit bytes as a sequence of '0' and '1' characters, with the least significant bits (lsb) first.
|
|
template<typename Type > |
std::string | bitdump_be8_type (const Type &t) |
| deprecated method: unclear naming and documentation.
|
|
|
std::string | hexdump (const void *const data, size_t size) |
| Dump a (binary) string as a sequence of uppercase hexadecimal pairs.
|
|
std::string | hexdump (const std::string &str) |
| Dump a (binary) string as a sequence of uppercase hexadecimal pairs.
|
|
std::string | hexdump (const std::vector< char > &data) |
| Dump a char vector as a sequence of uppercase hexadecimal pairs.
|
|
std::string | hexdump (const std::vector< std::uint8_t > &data) |
| Dump a uint8_t vector as a sequence of uppercase hexadecimal pairs.
|
|
std::string | hexdump_sourcecode (const std::string &str, const std::string &var_name="name") |
| Dump a (binary) string into a C source code snippet.
|
|
std::string | hexdump_lc (const void *const data, size_t size) |
| Dump a (binary) string as a sequence of lowercase hexadecimal pairs.
|
|
std::string | hexdump_lc (const std::string &str) |
| Dump a (binary) string as a sequence of lowercase hexadecimal pairs.
|
|
std::string | hexdump_lc (const std::vector< char > &data) |
| Dump a char vector as a sequence of lowercase hexadecimal pairs.
|
|
std::string | hexdump_lc (const std::vector< std::uint8_t > &data) |
| Dump a uint8_t vector as a sequence of lowercase hexadecimal pairs.
|
|
std::string | parse_hexdump (const std::string &str) |
| Read a string as a sequence of hexadecimal pairs.
|
|
template<typename Type > |
std::string | hexdump_type (const Type &t) |
| Dump a (binary) item as a sequence of uppercase hexadecimal pairs.
|
|
template<typename Type > |
std::string | hexdump_lc_type (const Type &t) |
| Dump a (binary) item as a sequence of lowercase hexadecimal pairs.
|
|
|
std::string | join (char glue, const std::vector< std::string > &parts) |
| Join a vector of strings by some glue character between each pair from the sequence.
|
|
std::string | join (const char *glue, const std::vector< std::string > &parts) |
| Join a vector of strings by some glue string between each pair from the sequence.
|
|
std::string | join (const std::string &glue, const std::vector< std::string > &parts) |
| Join a vector of strings by some glue string between each pair from the sequence.
|
|
template<typename Glue , typename Iterator > |
static std::string | join (Glue glue, Iterator first, Iterator last) |
| Join a sequence of strings by some glue string between each pair from the sequence.
|
|
template<typename Container > |
static std::string | join (char glue, const Container &parts) |
| Join a Container of strings by some glue character between each pair from the sequence.
|
|
template<typename Container > |
static std::string | join (const char *glue, const Container &parts) |
| Join a Container of strings by some glue string between each pair from the sequence.
|
|
template<typename Container > |
static std::string | join (const std::string &glue, const Container &parts) |
| Join a Container of strings by some glue string between each pair from the sequence.
|
|
std::string | join_quoted (const std::vector< std::string > &str, char sep, char quote, char escape) |
| Join a vector of strings using a separator character.
|
|
std::string | join_quoted (const std::vector< std::string > &str) |
| Join a vector of strings using spaces as separator character.
|
|
std::vector< std::string > | split (char sep, const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator character into distinct substrings.
|
|
std::vector< std::string > | split (const char *sep, const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > | split (const std::string &sep, const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > | split (char sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit) |
| Split the given string at each separator character into distinct substrings.
|
|
std::vector< std::string > | split (const char *sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > | split (const std::string &sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > & | split (std::vector< std::string > *into, char sep, const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator character into distinct substrings.
|
|
std::vector< std::string > & | split (std::vector< std::string > *into, const char *sep, const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > & | split (std::vector< std::string > *into, const std::string &sep, const std::string &str, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > & | split (std::vector< std::string > *into, char sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit) |
| Split the given string at each separator character into distinct substrings.
|
|
std::vector< std::string > & | split (std::vector< std::string > *into, const char *sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > & | split (std::vector< std::string > *into, const std::string &sep, const std::string &str, std::string::size_type min_fields, std::string::size_type limit) |
| Split the given string at each separator string into distinct substrings.
|
|
std::vector< std::string > | split_quoted (const std::string &str, char sep, char quote, char escape) |
| Split the given string at each separator character into distinct substrings.
|
|
std::vector< std::string > | split_quoted (const std::string &str) |
| Split the given string at each space into distinct substrings.
|
|
template<typename Functor > |
static void | split_view (char sep, const std::string &str, Functor &&callback, std::string::size_type limit=std::string::npos) |
| Split the given string at each separator character into distinct substrings, and call the given callback with a StringView for each substring.
|
|
|
std::string & | replace_first (std::string *str, const std::string &needle, const std::string &instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string & | replace_first (std::string *str, const std::string &needle, const char *instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string & | replace_first (std::string *str, const char *needle, const std::string &instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string & | replace_first (std::string *str, const char *needle, const char *instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string & | replace_first (std::string *str, char needle, char instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string | replace_first (const std::string &str, const std::string &needle, const std::string &instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string | replace_first (const std::string &str, const std::string &needle, const char *instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string | replace_first (const std::string &str, const char *needle, const std::string &instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string | replace_first (const std::string &str, const char *needle, const char *instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string | replace_first (const std::string &str, char needle, char instead) |
| Replace only the first occurrence of needle in str.
|
|
std::string & | replace_all (std::string *str, const std::string &needle, const std::string &instead) |
| Replace all occurrences of needle in str.
|
|
std::string & | replace_all (std::string *str, const std::string &needle, const char *instead) |
| Replace all occurrences of needle in str.
|
|
std::string & | replace_all (std::string *str, const char *needle, const std::string &instead) |
| Replace all occurrences of needle in str.
|
|
std::string & | replace_all (std::string *str, const char *needle, const char *instead) |
| Replace all occurrences of needle in str.
|
|
std::string & | replace_all (std::string *str, char needle, char instead) |
| Replace all occurrences of needle in str.
|
|
std::string | replace_all (const std::string &str, const std::string &needle, const std::string &instead) |
| Replace all occurrences of needle in str.
|
|
std::string | replace_all (const std::string &str, const std::string &needle, const char *instead) |
| Replace all occurrences of needle in str.
|
|
std::string | replace_all (const std::string &str, const char *needle, const std::string &instead) |
| Replace all occurrences of needle in str.
|
|
std::string | replace_all (const std::string &str, const char *needle, const char *instead) |
| Replace all occurrences of needle in str.
|
|
std::string | replace_all (const std::string &str, char needle, char instead) |
| Replace all occurrences of needle in str.
|
|
|
std::string & | trim (std::string *str) |
| Trims the given string in-place on the left and right.
|
|
std::string & | trim (std::string *str, const char *drop) |
| Trims the given string in-place on the left and right.
|
|
std::string & | trim (std::string *str, const std::string &drop) |
| Trims the given string in-place on the left and right.
|
|
std::string | trim (const std::string &str) |
| Trims the given string in-place on the left and right.
|
|
std::string | trim (const std::string &str, const char *drop) |
| Trims the given string in-place on the left and right.
|
|
std::string | trim (const std::string &str, const std::string &drop) |
| Trims the given string in-place on the left and right.
|
|
std::string & | trim_right (std::string *str) |
| Trims the given string in-place only on the right.
|
|
std::string & | trim_right (std::string *str, const char *drop) |
| Trims the given string in-place only on the right.
|
|
std::string & | trim_right (std::string *str, const std::string &drop) |
| Trims the given string in-place only on the right.
|
|
std::string | trim_right (const std::string &str) |
| Trims the given string only on the right.
|
|
std::string | trim_right (const std::string &str, const char *drop) |
| Trims the given string only on the right.
|
|
std::string | trim_right (const std::string &str, const std::string &drop) |
| Trims the given string only on the right.
|
|
std::string & | trim_left (std::string *str) |
| Trims the given string in-place only on the left.
|
|
std::string & | trim_left (std::string *str, const char *drop) |
| Trims the given string in-place only on the left.
|
|
std::string & | trim_left (std::string *str, const std::string &drop) |
| Trims the given string in-place only on the left.
|
|
std::string | trim_left (const std::string &str) |
| Trims the given string only on the left.
|
|
std::string | trim_left (const std::string &str, const char *drop) |
| Trims the given string only on the left.
|
|
std::string | trim_left (const std::string &str, const std::string &drop) |
| Trims the given string only on the left.
|
|