implementing a variadic zip function with const-correctness
I'm trying to implement a zip function. zip 's parameters are each wrapped<Ti> , where Ti varies from parameter to parameter. zip takes these wrapped<Ti> s and produces a wrapped<tuple<T1&,T2&,...TN&>> , or in other words a wrapped tuple of references to its parameters. The references should preserve const -ness. Here's my first stab at zip with one parameter, which doesn't work in general: #include <utility> #include <tuple> // implement forward_as_tuple as it is missing on my system namespace ns { template<typename... Types> std::tuple<Types&&...> forward_as_tuple(Types&&... t) { return std: