Skip to content

Instantly share code, notes, and snippets.

@ConorWilliams
ConorWilliams / zip.h
Last active July 1, 2021 15:30
Zip like Python in C++! A zip() function for ranges based for loops. See it working: https://godbolt.org/z/6AJdhk
// Copyright (c) 2019, Conor Williams
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
// Compiling on gcc 9.2 with: -std=c++2a -O3 -fconcepts
#ifndef ZIP_CPP
#define ZIP_CPP