Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class T>
- generator< pair<int, T> > enumerate(generator<T> gen){
- int idx = 0;
- while ( T val = gen() ){
- yield {idx, val};
- idx++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement