You can assign the object this
points at:
*this = XY;
But you can’t assign the direct value of this
:
this = &XY; // Error: Expression is not assignable
More Related Contents:
- Difference between this. and this->
- When should I make explicit use of the `this` pointer?
- In a templated derived class, why do I need to qualify base class member names with “this->” inside a member function?
- Why is ‘this’ a pointer and not a reference?
- What is the ‘this’ pointer?
- std::shared_ptr of this
- Excessive use of `this` in C++ [duplicate]
- Use of “this” keyword in C++ [duplicate]
- Is it safe to use the “this” pointer in an initialization list?
- What does ‘return *this’ mean in C++?
- C++ Matrix Class
- Difference between ‘struct’ and ‘typedef struct’ in C++?
- Is a string literal in С++ created in static memory?
- NULL vs nullptr (Why was it replaced?) [duplicate]
- Why do people use __ (double underscore) so much in C++
- A most vexing parse error: constructor with no arguments
- How do I set, clear, and toggle a single bit?
- Qt 5.1.1: Application failed to start because platform plugin “windows” is missing
- Memory alignment in C-structs
- Why do I need to use typedef typename in g++ but not VS?
- Two calls to destructor
- Which Boost libraries are header-only?
- How typedef works for function pointers
- Getting big random numbers in C/C++
- Double delete in initializer_list vs 2013
- In C++ what causes an assignment to evaluate as true or false when used in a control structure?
- Initialise Eigen::vector with std::vector
- Pros & Cons of putting all code in Header files in C++?
- using SFINAE for template class specialisation
- Questions regarding C++ non-POD unions