MT Core (C++)
Core library for replacing C++ standard in project usage
|
Additional algorithms that can be performed on slices, such as comparisons, searching, etc. More...
Classes | |
struct | SearchIndexes |
struct | SplitIter |
struct | SplitIter< T, Slice< T > > |
Functions | |
template<typename T> | |
bool | starts_with (const Slice< T > &needle, const Slice< T > &haystack) |
Checks whether a slice (the haystack) starts with elements in another slice in the same order (the needle) - \(O(N)\) Uses the equality operator of the underlying type E.g. | |
template<typename T> | |
void | shift (Slice< T > slice, size_t amt) |
template<typename T> | |
bool | starts_with (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Checks whether a slice (the haystack) starts with a specific element (the needle) - \(O(N)\) Uses the equality operator of the underlying type E.g. | |
template<typename T> | |
bool | contains (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Checks whether a slice (the haystack) contains an element (the needle) Uses the equality operator of the underlying type E.g. | |
template<typename T> | |
bool | contains (const Slice< T > &needle, const Slice< T > &haystack) |
Checks whether a slice (the haystack) contains elements in another slice in the same order (the needle) - \(O(N^2)\) Uses the equality operator of the underlying type E.g. | |
template<typename T> | |
mtcore::Optional< size_t > | first_index_not_proceeded_by (const std::remove_const_t< T > &prefix, const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Gets the first index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
mtcore::Optional< size_t > | first_index_not_proceeded_by (const std::remove_const_t< T > &prefix, const Slice< T > &needle, const Slice< T > &haystack) |
Gets the first index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
mtcore::Optional< size_t > | first_index (const Slice< T > &needle, const Slice< T > &haystack) |
Gets the first index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
mtcore::Optional< size_t > | first_index_not (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Gets the first index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
mtcore::Optional< size_t > | first_index (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Gets the first index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
mtcore::Optional< size_t > | last_index (const Slice< T > &needle, const Slice< T > &haystack) |
Gets the last index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
mtcore::Optional< size_t > | last_index (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Gets the last index that a needle appears in the haystack, or nullopt if the needle does not appear - \(O(N^2)\) Uses the equality operator of the underlying type. | |
template<typename T> | |
SearchIndexes< T, Slice< T > > | indexes_of (const Slice< T > &needle, const Slice< T > &haystack) |
Returns an iterator of all indexes of occurrences of a needle in a haystack If the needle isn't present, will return an empty iterator. | |
template<typename T> | |
SearchIndexes< T, std::remove_const_t< T > > | indexes_of (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Returns an iterator of all indexes of occurrences of a needle in a haystack If the needle isn't present, will return an empty iterator. | |
template<typename T> | |
SplitIter< T, Slice< T > > | split (const Slice< T > &needle, const Slice< T > &haystack) |
Splits a slice into smaller sub slices. | |
template<typename T> | |
SplitIter< T, std::remove_const_t< T > > | split (const std::remove_const_t< T > &needle, const Slice< T > &haystack) |
Splits a slice into smaller sub slices. | |
Additional algorithms that can be performed on slices, such as comparisons, searching, etc.
void mtcore::slices::shift | ( | Slice< T > | slice, |
size_t | amt ) |
Definition at line 58 of file slice_algo.hpp.