Skip to content

Commit 7fbe096

Browse files
committed
renamed functional_pair to just pair (it's already scoped to functional_vector)
1 parent 3592b9d commit 7fbe096

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

include/functional_vector.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class functional_vector
247247
}
248248

249249
template <typename U>
250-
struct functional_pair
250+
struct pair
251251
{
252252
T first;
253253
U second;
@@ -271,7 +271,7 @@ class functional_vector
271271
// const auto zipped_vector = ages_vector.zip(names_vector);
272272
//
273273
// outcome:
274-
// zipped_vector -> functional_vector<functional_vector<int>::functional_pair<std::string>>({
274+
// zipped_vector -> functional_vector<functional_vector<int>::pair<std::string>>({
275275
// (32, "Jake"),
276276
// (25, "Mary"),
277277
// (53, "John"),
@@ -280,15 +280,15 @@ class functional_vector
280280
// is equivalent to:
281281
// const functional_vector ages_vector({32, 25, 53});
282282
// const functional_vector<std::string> names_vector({"Jake", "Mary", "John"});
283-
// functional_vector<functional_vector<int>::functional_pair<std::string>> zipped_vector;
283+
// functional_vector<functional_vector<int>::pair<std::string>> zipped_vector;
284284
// for (auto i = 0; i < ages_vector.size(); ++i) {
285-
// functional_vector<int>::functional_pair<std::string> tuple;
285+
// functional_vector<int>::pair<std::string> tuple;
286286
// tuple.first = ages_vector[i];
287287
// tuple.second = names_vector[i];
288288
// zipped_vector.insert_back(tuple);
289289
// }
290290
template <typename U>
291-
[[nodiscard]] functional_vector<functional_pair<U>> zip(const functional_vector<U>& vector) const
291+
[[nodiscard]] functional_vector<pair<U>> zip(const functional_vector<U>& vector) const
292292
{
293293
return zip_impl(vector.cbegin(), vector.cend());
294294
}
@@ -303,7 +303,7 @@ class functional_vector
303303
// const auto zipped_vector = ages_vector.zip(names_vector);
304304
//
305305
// outcome:
306-
// zipped_vector -> functional_vector<functional_vector<int>::functional_pair<std::string>>({
306+
// zipped_vector -> functional_vector<functional_vector<int>::pair<std::string>>({
307307
// (32, "Jake"),
308308
// (25, "Mary"),
309309
// (53, "John"),
@@ -312,15 +312,15 @@ class functional_vector
312312
// is equivalent to:
313313
// const functional_vector ages_vector({32, 25, 53});
314314
// const std::vector<std::string> names_vector({"Jake", "Mary", "John"});
315-
// functional_vector<functional_vector<int>::functional_pair<std::string>> zipped_vector;
315+
// functional_vector<functional_vector<int>::pair<std::string>> zipped_vector;
316316
// for (auto i = 0; i < ages_vector.size(); ++i) {
317-
// functional_vector<int>::functional_pair<std::string> tuple;
317+
// functional_vector<int>::pair<std::string> tuple;
318318
// tuple.first = ages_vector[i];
319319
// tuple.second = names_vector[i];
320320
// zipped_vector.insert_back(tuple);
321321
// }
322322
template <typename U>
323-
[[nodiscard]] functional_vector<functional_pair<U>> zip(const std::vector<U>& vector) const
323+
[[nodiscard]] functional_vector<pair<U>> zip(const std::vector<U>& vector) const
324324
{
325325
return zip_impl(vector.cbegin(), vector.cend());
326326
}
@@ -331,7 +331,7 @@ class functional_vector
331331
// const auto zipped_vector = ages_vector.zip(names_vector);
332332
//
333333
// outcome:
334-
// zipped_vector -> functional_vector<functional_vector<int>::functional_pair<std::string>>({
334+
// zipped_vector -> functional_vector<functional_vector<int>::pair<std::string>>({
335335
// (32, "Jake"),
336336
// (25, "Mary"),
337337
// (53, "John"),
@@ -340,15 +340,15 @@ class functional_vector
340340
// is equivalent to:
341341
// const functional_vector ages_vector({32, 25, 53});
342342
// const std::initializer_list<std::string> names_vector({"Jake", "Mary", "John"});
343-
// functional_vector<functional_vector<int>::functional_pair<std::string>> zipped_vector;
343+
// functional_vector<functional_vector<int>::pair<std::string>> zipped_vector;
344344
// for (auto i = 0; i < ages_vector.size(); ++i) {
345-
// functional_vector<int>::functional_pair<std::string> tuple;
345+
// functional_vector<int>::pair<std::string> tuple;
346346
// tuple.first = ages_vector[i];
347347
// tuple.second = names_vector[i];
348348
// zipped_vector.insert_back(tuple);
349349
// }
350350
template <typename U>
351-
[[nodiscard]] functional_vector<functional_pair<U>> zip(const std::initializer_list<U>& list) const
351+
[[nodiscard]] functional_vector<pair<U>> zip(const std::initializer_list<U>& list) const
352352
{
353353
return zip_impl(list.begin(), list.end());
354354
}
@@ -1281,19 +1281,19 @@ class functional_vector
12811281

12821282
template<typename Iterator, typename = std::enable_if_t<is_valid_iterator<Iterator>::value>>
12831283
[[nodiscard]] auto zip_impl( const Iterator& vec_begin, const Iterator & vec_end) const ->
1284-
functional_vector<functional_pair<deref_type<Iterator>>>
1284+
functional_vector<pair<deref_type<Iterator>>>
12851285
{
12861286
using U = deref_type<Iterator>;
12871287

12881288
const auto vec_size = std::distance(vec_begin, vec_end);
12891289
assert(backing_vector_.size() == vec_size);
1290-
std::vector<functional_pair<U>> combined_vector;
1290+
std::vector<pair<U>> combined_vector;
12911291
combined_vector.reserve(vec_size);
12921292
for (size_t i = 0; i < vec_size; ++i)
12931293
{
12941294
combined_vector.push_back({backing_vector_[i], *(vec_begin + i)});
12951295
}
1296-
return functional_vector<functional_pair<U>>(std::move(combined_vector));
1296+
return functional_vector<pair<U>>(std::move(combined_vector));
12971297
}
12981298

12991299
// checks if the value of dereferencing the passed Iterators is convertible to type T

0 commit comments

Comments
 (0)