| 98 | template <typename Container, |
| 99 | typename T = typename Container::value_type> |
| 100 | Container extrapolate_replicate(std::size_t count_begin, std::size_t count_end, |
| 101 | const Container& xs) |
| 102 | { |
| 103 | assert(is_not_empty(xs)); |
| 104 | Container ys; |
| 105 | const auto xs_size = size_of_cont(xs); |
| 106 | internal::prepare_container(ys, xs_size + count_begin + count_end); |
| 107 | auto it = internal::get_back_inserter(ys); |
| 108 | const signed int idx_end = static_cast<signed int>(xs_size + count_end); |
| 109 | const signed int idx_start = -static_cast<signed int>(count_begin); |
| 110 | for (signed int idx = idx_start; idx < idx_end; ++idx) { |
| 111 | *it = elem_at_idx_or_replicate(idx, xs); |
| 112 | } |
| 113 | return ys; |
| 114 | } |
| 115 | |
| 116 | // API search type: extrapolate_wrap : (Int, Int, [a]) -> [a] |
| 117 | // fwd bind count: 2 |
no test coverage detected