C++ Template Metaprogramming
Solutions to the exercises throughout the book
|
Why use transform_view
?
Why use transform_view
?
7-1. Our implementation of zip_iterator uses transform to generate its nested ::type. Would using transform_view instead yield any advantages in this case?
transform_view
might yield some benefit if the caller doesn't examine all the elements in the "zipped" element, but this is a strange case — it's unlikely someone would zip the contents of multiple sequences and only look at a subset of those sequences when iterating.