Skip to content

Commit 3b5a9a4

Browse files
committed
renamed private members
1 parent 4dce262 commit 3b5a9a4

File tree

2 files changed

+103
-103
lines changed

2 files changed

+103
-103
lines changed

include/set.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,27 @@ class set
4141
{
4242
public:
4343
set()
44-
: backing_set_()
44+
: m_set()
4545
{
4646
}
4747

4848
explicit set(std::set<TKey, TCompare> set)
49-
: backing_set_(std::move(set))
49+
: m_set(std::move(set))
5050
{
5151
}
5252

5353
explicit set(const std::vector<TKey>& vector)
54-
: backing_set_(vector.begin(), vector.end())
54+
: m_set(vector.begin(), vector.end())
5555
{
5656
}
5757

5858
explicit set(const vector<TKey>& vector)
59-
: backing_set_(vector.begin(), vector.end())
59+
: m_set(vector.begin(), vector.end())
6060
{
6161
}
6262

6363
explicit set(const std::initializer_list<TKey>& list)
64-
: backing_set_(list.begin(), list.end())
64+
: m_set(list.begin(), list.end())
6565
{
6666
}
6767

@@ -206,7 +206,7 @@ class set
206206
set<UKey, UCompare> map(Transform && transform) const
207207
{
208208
std::set<UKey, UCompare> transformed_set;
209-
for (const auto& key: backing_set_) {
209+
for (const auto& key: m_set) {
210210
transformed_set.insert(transform(key));
211211
}
212212
return set<UKey, UCompare>(transformed_set);
@@ -325,7 +325,7 @@ class set
325325
copy.insert(*it);
326326
}
327327
}
328-
backing_set_ = std::move(copy);
328+
m_set = std::move(copy);
329329
return *this;
330330
}
331331

@@ -447,7 +447,7 @@ class set
447447
// numbers -> fcpp::set<int>({1, 2})
448448
set& remove(const TKey& element)
449449
{
450-
backing_set_.erase(element);
450+
m_set.erase(element);
451451
return *this;
452452
}
453453

@@ -462,7 +462,7 @@ class set
462462
// numbers -> fcpp::set<int>({1, 2, 4})
463463
[[nodiscard]] set removing(const TKey& element) const
464464
{
465-
auto copy(backing_set_);
465+
auto copy(m_set);
466466
copy.erase(element);
467467
return set(copy);
468468
}
@@ -477,7 +477,7 @@ class set
477477
// numbers -> fcpp::set<int>({1, 2, 4, 18})
478478
set& insert(const TKey& element)
479479
{
480-
backing_set_.insert(element);
480+
m_set.insert(element);
481481
return *this;
482482
}
483483

@@ -492,7 +492,7 @@ class set
492492
// numbers -> fcpp::set<int>({1, 2, 4})
493493
[[nodiscard]] set inserting(const TKey& element) const
494494
{
495-
auto copy(backing_set_);
495+
auto copy(m_set);
496496
copy.insert(element);
497497
return set(copy);
498498
}
@@ -507,7 +507,7 @@ class set
507507
// numbers -> fcpp::set<int>({})
508508
set& clear()
509509
{
510-
backing_set_.clear();
510+
m_set.clear();
511511
return *this;
512512
}
513513

@@ -533,13 +533,13 @@ class set
533533
// numbers.contains(15); // false
534534
[[nodiscard]] bool contains(const TKey& key) const
535535
{
536-
return backing_set_.count(key) != 0;
536+
return m_set.count(key) != 0;
537537
}
538538

539539
// Returns the size of the vector (how many elements it contains, it may be different from its capacity)
540540
[[nodiscard]] size_t size() const
541541
{
542-
return backing_set_.size();
542+
return m_set.size();
543543
}
544544

545545
// clear
@@ -548,25 +548,25 @@ class set
548548
// Returns the begin iterator, useful for other standard library algorithms
549549
[[nodiscard]] typename std::set<TKey>::iterator begin()
550550
{
551-
return backing_set_.begin();
551+
return m_set.begin();
552552
}
553553

554554
// Returns the const begin iterator, useful for other standard library algorithms
555555
[[nodiscard]] typename std::set<TKey>::const_iterator begin() const
556556
{
557-
return backing_set_.begin();
557+
return m_set.begin();
558558
}
559559

560560
// Returns the end iterator, useful for other standard library algorithms
561561
[[nodiscard]] typename std::set<TKey>::iterator end()
562562
{
563-
return backing_set_.end();
563+
return m_set.end();
564564
}
565565

566566
// Returns the const end iterator, useful for other standard library algorithms
567567
[[nodiscard]] typename std::set<TKey>::const_iterator end() const
568568
{
569-
return backing_set_.end();
569+
return m_set.end();
570570
}
571571

572572
// Returns the given key in the current set, allowing subscripting.
@@ -642,7 +642,7 @@ class set
642642
}
643643

644644
private:
645-
std::set<TKey, TCompare> backing_set_;
645+
std::set<TKey, TCompare> m_set;
646646

647647
void assert_smaller_size(const size_t index) const
648648
{

0 commit comments

Comments
 (0)