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
+5 -5
View File
@@ -115,12 +115,12 @@ class MessageReference {
* `0x1337420` so it's at least obvious where it's coming from if we get a
* segfault caused by a read to that address.
*/
MessageReference() noexcept : object(reinterpret_cast<T*>(0x1337420)) {}
MessageReference() noexcept : object_(reinterpret_cast<T*>(0x1337420)) {}
/**
* Store a reference in this object.
*/
MessageReference(T& object) noexcept : object(&object) {}
MessageReference(T& object) noexcept : object_(&object) {}
using Response = typename T::Response;
@@ -128,12 +128,12 @@ class MessageReference {
* Get the reference to the object. This is the same interface as
* `std::reference_wrapper<T>`.
*/
T& get() const noexcept { return *object; }
constexpr operator T&() const noexcept { return *object; }
T& get() const noexcept { return *object_; }
constexpr operator T&() const noexcept { return *object_; }
// You cannot serialize a reference directly, use the Bitsery extension
// mentioned above instead
private:
T* object;
T* object_;
};