Add underscores to private data members (#898)

This is the last PR I plan to have focused on #720
This commit is contained in:
Jon Meow
2021-10-19 14:27:10 -07:00
committed by GitHub
parent dc9c36660b
commit ffa4e76ede
17 changed files with 363 additions and 356 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ class BisonWrap {
public:
// Assigning a value initializes the wrapper.
auto operator=(T&& rhs) -> BisonWrap& {
val = std::move(rhs);
val_ = std::move(rhs);
return *this;
}
@@ -29,14 +29,14 @@ class BisonWrap {
// Deliberately releases the contained value. Errors if not initialized.
// Called directly in parser.ypp when releasing pairs.
auto Release() -> T {
CHECK(val.has_value());
T ret = std::move(*val);
val.reset();
CHECK(val_.has_value());
T ret = std::move(*val_);
val_.reset();
return ret;
}
private:
std::optional<T> val;
std::optional<T> val_;
};
} // namespace Carbon