@@ -20,7 +20,8 @@ template <typename F, tuplelike... Ts> constexpr auto apply(F &&f, Ts &&...ts) {
2020 constexpr auto total_num_elements =
2121 (std::size_t {} + ... + stdx::tuple_size_v<std::remove_cvref_t <Ts>>);
2222
23- [[maybe_unused]] constexpr auto element_indices = [&] {
23+ [[maybe_unused]] constexpr auto element_indices =
24+ [&]() -> std::array<detail::index_pair, total_num_elements> {
2425 std::array<detail::index_pair, total_num_elements> indices{};
2526 [[maybe_unused]] auto p = indices.data ();
2627 ((p = std::remove_cvref_t <Ts>::fill_inner_indices (p)), ...);
@@ -48,7 +49,8 @@ template <tuplelike... Ts> [[nodiscard]] constexpr auto tuple_cat(Ts &&...ts) {
4849 constexpr auto total_num_elements =
4950 (std::size_t {} + ... + stdx::tuple_size_v<std::remove_cvref_t <Ts>>);
5051
51- [[maybe_unused]] constexpr auto element_indices = [&] {
52+ [[maybe_unused]] constexpr auto element_indices =
53+ [&]() -> std::array<detail::index_pair, total_num_elements> {
5254 std::array<detail::index_pair, total_num_elements> indices{};
5355 auto p = indices.data ();
5456 ((p = std::remove_cvref_t <Ts>::fill_inner_indices (p)), ...);
@@ -112,7 +114,7 @@ template <template <typename T> typename Pred, tuplelike T>
112114 (std::size_t {} + ... +
113115 (Pred<stdx::tuple_element_t <Is, tuple_t >>::value ? std::size_t {1 }
114116 : std::size_t {}));
115- constexpr auto indices = [] {
117+ constexpr auto indices = []() -> std::array<std:: size_t , num_matches> {
116118 auto a = std::array<std::size_t , num_matches>{};
117119 [[maybe_unused]] auto it = a.begin ();
118120 [[maybe_unused]] auto copy_index =
@@ -286,7 +288,8 @@ struct chunk {
286288
287289template <tuplelike T, template <typename > typename Proj = std::type_identity_t >
288290 requires (tuple_size_v<T> > 1 )
289- [[nodiscard]] constexpr auto create_chunks () {
291+ [[nodiscard]] constexpr auto create_chunks ()
292+ -> std::array<chunk, count_chunks<T, Proj>()> {
290293 auto index = std::size_t {};
291294 std::array<chunk, count_chunks<T, Proj>()> chunks{};
292295 ++chunks[index].size ;
@@ -410,11 +413,11 @@ template <template <typename> typename Proj = std::type_identity_t,
410413 sorted_idxs[Is], sorted_idxs[Is + 1 ]>...};
411414 }(std::make_index_sequence<stdx::tuple_size_v<tuple_t > - 1 >{});
412415
413- constexpr auto chunks = [&] {
414- constexpr auto chunk_count =
415- std::count (std::begin (tests), std::end (tests), false ) + 1 ;
416+ constexpr auto chunk_count =
417+ std::count (std::begin (tests), std::end (tests), false ) + 1 ;
418+ constexpr auto chunks =
419+ [&]() -> std::array<detail::chunk, chunk_count> {
416420 std::array<detail::chunk, chunk_count> cs{};
417-
418421 auto index = std::size_t {};
419422 ++cs[index].size ;
420423 for (auto i = std::size_t {}; i < std::size (tests); ++i) {
0 commit comments