@@ -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 ();
0 commit comments