Changeset 1b8fc06c for src/Common
- Timestamp:
- Apr 13, 2023, 4:47:05 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 8a2f7f1, fb4dc28
- Parents:
- 32d6fdc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/Iterate.hpp
r32d6fdc r1b8fc06c 20 20 #include <iterator> 21 21 22 // it's nice to actually be able to increment iterators by an arbitrary amount22 // Returns an iterator that is it advanced n times. 23 23 template< class InputIt, class Distance > 24 24 InputIt operator+( InputIt it, Distance n ) { … … 50 50 51 51 // ----------------------------------------------------------------------------- 52 // Helper struct and function to support 53 // for ( val_and_index : enumerate( container ) ) {} 54 // which iterates through the container and tracks the index as well. 55 52 56 template< typename T > 53 57 struct enumerate_t { … … 109 113 110 114 // ----------------------------------------------------------------------------- 115 // Helper function to transform one iterable container into another. 116 111 117 template< typename OutType, typename Range, typename Functor > 112 118 OutType map_range( const Range& range, Functor&& functor ) { … … 206 212 // Helper struct and function to support 207 213 // for ( val : lazy_map( container1, f ) ) {} 208 // syntax to have a for each that iterates a container, mapping each element by applying f 214 // syntax to have a for each that iterates a container, 215 // mapping each element by applying f. 216 209 217 template< typename T, typename Func > 210 218 struct lambda_iterate_t {
Note: See TracChangeset
for help on using the changeset viewer.