We currently call a lot of functions with the same list of types. To avoid forgetting any of them, this patch adds type_lists and utilities for it. Specifically, it adds
- type_list - This is just a list of types
- concatenate - This allows concatenating type_lists
- for_each - Iterate over a type_list
@philnik and I just played around with this, wondering what things would look like if we had a typelist and a foreach-like utility. I think we could get most of the benefits in this patch without incurring to much complexity. This is what this test would look like:
meta::for_each(meta::forward_iterator_list<int*>{}, []<class Out>() { test_iterators<cpp20_input_iterator<int*>, Out>(); test_iterators<ProxyIterator<cpp20_input_iterator<int*>>, Out>(); meta::for_each(meta::forward_iterator_list<int*>{}, []<class In>() { test_iterators<In, Out>(); test_iterators<In, Out, sized_sentinel<In>>(); test_iterators<In, Out, sentinel_wrapper<In>>(); test_iterators<ProxyIterator<In>, Out>(); test_iterators<ProxyIterator<In>, Out, sized_sentinel<ProxyIterator<In>>>(); test_iterators<ProxyIterator<In>, Out, sentinel_wrapper<ProxyIterator<In>>>(); }); });