(C++) this
February 24, 2017 · View on GitHub
(C++) this
this is a keyword to obtain a pointer to a class instance's own address.
When using this to access member variables or member functions, this can be left out.
Example
struct Int { //Constructor Int(const int i) : m_x(i) {} int GetValue() { //this can be omitted return this->m_x; } void SetValue(const int x) { //this can be omitted this->m_x = x; } const Int * const GetMe() { return this; } private: int m_x; };