|
CPP-TOOLBOX
|
Functions | |
| template<typename T> | |
| std::vector< T > | join_vectors (const std::vector< T > &v1, const std::vector< T > &v2) |
| Concatenate two vectors into a single vector. | |
| template<typename T, typename Func> | |
| void | for_each_in_vector (std::vector< T > &vec, Func func) |
| Apply a function to each element of a modifiable vector. | |
| template<typename Container> | |
| bool | any_of (const Container &c) |
| Check if any element in the container evaluates to true. | |
| template<typename Container> | |
| bool | all_of (const Container &c) |
| Check if all elements in the container evaluate to true. | |
| template<typename T, typename Func> | |
| void | for_each_in_vector (const std::vector< T > &vec, Func func) |
| Apply a function to each element of a read-only vector. | |
| template<typename T> | |
| std::vector< T > | join_all_vectors (const std::vector< std::vector< T > > &vectors) |
| Concatenate a list of vectors into a single vector. | |
| template<typename T, typename Func> | |
| auto | map_vector (const std::vector< T > &vec, Func func) |
| Transform a vector by applying a function to each element. | |
| bool collection_utils::all_of | ( | const Container & | c | ) |
Check if all elements in the container evaluate to true.
Elements are cast to bool before evaluation.
| Container | Type of container supporting begin() and end(). |
| c | Container to check. |
| bool collection_utils::any_of | ( | const Container & | c | ) |
Check if any element in the container evaluates to true.
Elements are cast to bool before evaluation.
| Container | Type of container supporting begin() and end(). |
| c | Container to check. |
| void collection_utils::for_each_in_vector | ( | const std::vector< T > & | vec, |
| Func | func ) |
Apply a function to each element of a read-only vector.
| T | Type of elements in the vector. |
| Func | Type of the function to apply. Must be callable with const T&. |
| vec | Vector whose elements will be processed. |
| func | Function to apply to each element. |
| void collection_utils::for_each_in_vector | ( | std::vector< T > & | vec, |
| Func | func ) |
Apply a function to each element of a modifiable vector.
| T | Type of elements in the vector. |
| Func | Type of the function to apply. Must be callable with T&. |
| vec | Vector whose elements will be processed. |
| func | Function to apply to each element. |
| std::vector< T > collection_utils::join_all_vectors | ( | const std::vector< std::vector< T > > & | vectors | ) |
Concatenate a list of vectors into a single vector.
| T | Type of elements in the vectors. |
| vectors | A vector of vectors to join. |
| std::vector< T > collection_utils::join_vectors | ( | const std::vector< T > & | v1, |
| const std::vector< T > & | v2 ) |
Concatenate two vectors into a single vector.
| T | Type of elements in the vectors. |
| v1 | First vector. |
| v2 | Second vector. |
| auto collection_utils::map_vector | ( | const std::vector< T > & | vec, |
| Func | func ) |
Transform a vector by applying a function to each element.
| T | Type of input elements. |
| Func | Type of the function to apply. Must be callable with const T&. |
| vec | Input vector. |
| func | Function to apply to each element. |