E.V.E
v2023.02.15
Loading...
Searching...
No Matches

Detailed Description

Converts every part of a zip to their common type.

Variables

constexpr auto eve::algo::common_type = common_with_types<>

Variable Documentation

◆ common_type

auto eve::algo::common_type = common_with_types<>
inlineconstexpr
Header file #include <eve/module/algo.hpp>
namespace eve::algo
{
inline constexpr auto common_type = eve_implementation_defined;
}
constexpr auto common_type
Definition traits.hpp:387

Converts every part of a zip to the type eve::common_type reduces the parts to. A zipped range carries a type per part, and after the conversion every lane is of a single type.

eve::algo::equal and eve::algo::mismatch apply the trait themselves, and a comparison between ranges of different types is run on a single type. A custom predicate receives the parts as they are; if they are to be converted, the trait is passed on the algorithm.

std::vector<int> const v {1, 2, 3, 4};
std::vector<std::int8_t> c {'a', 'b', 'c', 'd'};
// Both parts read as int, as zipping the converted range would give.
constexpr auto zip
Given relaxed_iterors and relaxed ranges, zips them together (creates a single object)....
Definition zip.hpp:144
eve::result_t< zip, Vs... > zipped
Type helper to compute tuple-like result-type.
Definition zip.hpp:92
See also
eve::algo::views::zip, common_with_types, force_type