mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 14:51:03 +01:00
Add underscores to private data members (#898)
This is the last PR I plan to have focused on #720
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user