Change the naming scheme for class field members

I'm not a fan of Hungarian notation, but C++ kind of needs it with its
implicit `this`. And of all the common options for this, I find
suffixing members with an underscore the least offensive one.
This commit is contained in:
Robbert van der Helm
2022-01-01 21:07:17 +01:00
parent e0ab24e645
commit 0b9a16cf40
169 changed files with 2448 additions and 2405 deletions
+6 -6
View File
@@ -48,7 +48,7 @@ class MessageReference {
* won't be touched.
*/
MessageReference(std::optional<T>& backing_object)
: backing_object(backing_object){};
: backing_object_(backing_object){};
template <typename Ser, typename Fnc>
void serialize(Ser& ser,
@@ -59,15 +59,15 @@ class MessageReference {
template <typename Des, typename Fnc>
void deserialize(Des& des, ::MessageReference<T>& object_ref, Fnc&&) const {
if (!backing_object) {
backing_object.emplace();
if (!backing_object_) {
backing_object_.emplace();
}
// Since we cannot directly deserialize into a reference, we'll
// deserialize into this (persistent) backing object and then point the
// reference to this object.
des.object(*backing_object);
object_ref = *backing_object;
des.object(*backing_object_);
object_ref = *backing_object_;
}
private:
@@ -75,7 +75,7 @@ class MessageReference {
* This contains the actual `T` we'll deserialize into so we can point the
* reference to that object after deserializing.
*/
std::optional<T>& backing_object;
std::optional<T>& backing_object_;
};
} // namespace ext