Commit graph

10 commits

Author SHA1 Message Date
Kp b4341e69a5 Remove unnecessary definitions of get_static_size
These exist only to be declared, and never called.
2022-01-07 04:26:22 +00:00
Kp eea806bcc9 Pass underlying index_type through zip()
If std::common_type<range::index_type>... finds a common index_type
among all the zipped ranges, pass that common type through as
zip<...>::index_type.  Otherwise, set zip<...>::index_type to void.

This allows enumerate(zip(...))) to report a better index_type.
2021-11-01 03:37:20 +00:00
Kp e1aac6949a Replace __attribute_warn_unused_result with C++17 [[nodiscard]]
This eliminates a configure test, and may help readers understand the
annotation more readily.
2021-06-28 03:37:51 +00:00
Kp 15f9b3d43f Enable use of some STL algorithms on zip_iterator
std::find_if needs common iterator traits.  Add the relevant type
definitions to zip_iterator.

Also add them to d_range, to avoid errors when a range is zipped.
2020-12-27 22:03:09 +00:00
Kp 5b45fd3bae Add compile-time check that zip() will not exceed static sizes
This is necessarily incomplete since it can only check ranges that have
a compile-time static size.  However, it catches some simple mistakes,
and imposes no runtime cost, so it is still useful.
2020-08-28 00:18:45 +00:00
Kp ec6a78c481 Use enum class for marker index types 2020-07-22 03:11:18 +00:00
Kp daf06acfbe Replace zip helper function with class template argument deduction 2020-07-16 02:31:04 +00:00
Kp b396445efa Require support for std::index_sequence, std::make_index_sequence
The minimum supported compiler versions now provide a depth-efficient
implementation of std::make_index_sequence, which removes the last
reason to carry a private implementation.  In the case of clang, it
appears to have a special compiler intrinsic used to implement its
std::make_index_sequence.

Switch to the compiler-provided version for both gcc and clang.
2020-04-26 17:26:23 +00:00
Kp aaaf212dca Add unit test for zip iterator 2020-02-26 05:07:34 +00:00
Kp 538286e02c Add range helper zip() 2019-05-04 18:27:36 +00:00