Skip to content

Commit 94abcf3

Browse files
committed
cleaned up documentation
1 parent 9bf26f0 commit 94abcf3

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const auto colleagues_but_not_friends = colleagues.difference_with(friends);
310310
// find which friends are colleagues
311311
// same as colleagues.intersect_with(friends)
312312
// contains person(51, "George"), person(41, "Jackie")
313-
const auto good_colleagues = friends.intersection_with(colleagues);
313+
const auto good_colleagues = friends.intersect_with(colleagues);
314314

315315
// a set of close family members
316316
const fcpp::set<person, person_comparator> family({
@@ -322,8 +322,8 @@ const fcpp::set<person, person_comparator> family({
322322
// contains person(51, "George"), person(41, "Jackie"), person(42, "Crystal"), person(51, "Paul"), person(81, "Barbara")
323323
const auto friends_and_family = friends.union_with(family);
324324

325-
// all set keys in a vetor
326-
const fcpp::vector<person> = friends_and_family.keys();
325+
// all set keys in a vector
326+
const auto people = friends_and_family.keys();
327327
```
328328
329329
### zip, map, filter, reduce

include/set.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace fcpp {
3434
// of the standard library algorithms.
3535
//
3636
// Member functions can be mutating (eg. my_set.insert()) or
37-
// non-mutating (eg. my_vector.inserting()) enforcing thread safety if needed
37+
// non-mutating (eg. my_set.inserting()) enforcing thread safety if needed
3838
template <class TKey, class TCompare = std::less<TKey>>
3939
class set
4040
{
@@ -71,7 +71,7 @@ namespace fcpp {
7171
// example:
7272
// const fcpp::set<int> set1(std::set<int>({1, 2, 3, 5, 7, 8, 10}));
7373
// const fcpp::set<int> set2(std::set<int>({2, 5, 7, 10, 15, 17}));
74-
// const auto& diff = set1.difference(set2);
74+
// const auto& diff = set1.difference_with(set2);
7575
//
7676
// outcome:
7777
// diff -> fcpp::set<int>({1, 3, 8})
@@ -98,7 +98,7 @@ namespace fcpp {
9898
// example:
9999
// const fcpp::set<int> set1(std::set<int>({1, 2, 3, 5, 7, 8, 10}));
100100
// const fcpp::set<int> set2(std::set<int>({2, 5, 7, 10, 15, 17}));
101-
// const auto& combined = set1.set_union(set2);
101+
// const auto& combined = set1.union_with(set2);
102102
//
103103
// outcome:
104104
// combined -> fcpp::set<int>({1, 2, 3, 5, 7, 8, 10, 15, 17})
@@ -125,7 +125,7 @@ namespace fcpp {
125125
// example:
126126
// const fcpp::set<int> set1(std::set<int>({1, 2, 3, 5, 7, 8, 10}));
127127
// const fcpp::set<int> set2(std::set<int>({2, 5, 7, 10, 15, 17}));
128-
// const auto& combined = set1.set_union(set2);
128+
// const auto& combined = set1.intersect_with(set2);
129129
//
130130
// outcome:
131131
// combined -> fcpp::set<int>({2, 5, 7, 10})
@@ -191,7 +191,7 @@ namespace fcpp {
191191
// output of applying the transform function on every element of this instance.
192192
//
193193
// example:
194-
// const fcpp::vector<int> input_set({ 1, 3, -5 });
194+
// const fcpp::set<int> input_set({ 1, 3, -5 });
195195
// const auto output_set = input_set.map<std::string>([](const int& element) {
196196
// return std::to_string(element);
197197
// });
@@ -299,7 +299,7 @@ namespace fcpp {
299299
}
300300

301301
// Performs the functional `reduce` (fold/accumulate) algorithm, by returning the result of
302-
// accumulating all the values in the vector to an initial value. (non-mutating)
302+
// accumulating all the values in the set to an initial value. (non-mutating)
303303
//
304304
// example:
305305
// const fcpp::set<std::string> tokens({ "the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "brown", "dog" });
@@ -598,7 +598,7 @@ namespace fcpp {
598598
return m_set.count(key) != 0;
599599
}
600600

601-
// Returns the size of the vector (how many elements it contains, it may be different from its capacity)
601+
// Returns the size of the set (how many elements it contains, it may be different from its capacity)
602602
[[nodiscard]] size_t size() const
603603
{
604604
return m_set.size();

include/vector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ namespace fcpp {
604604
//
605605
// example:
606606
// fcpp::vector numbers({3, 1, 9, -4});
607-
// numbers.sort_ascending();
607+
// numbers.sort_descending();
608608
//
609609
// outcome:
610610
// numbers -> fcpp::vector({9, 3, 1, -4});
@@ -614,7 +614,7 @@ namespace fcpp {
614614
}
615615

616616
#ifdef PARALLEL_ALGORITHM_AVAILABLE
617-
// Performs the `sort_ascending` algorithm in parallel.
617+
// Performs the `sort_descending` algorithm in parallel.
618618
// See also the sequential version for more documentation.
619619
vector& sort_descending_parallel()
620620
{

0 commit comments

Comments
 (0)