AtheS21 AtheS21 - 1 year ago 88
C++ Question

What is the meaning of this+1 in C++

I was wandering through the code of Sequitur G2P and found a really strange line of code:

public:
...
const Node *childrenEnd() const { return (this+1)->finalized.firstChild_; }


I know that 'this' is a pointer to the current object, and since it is a pointer, the operation is perfectly legal, but what exactly does 'this+1' actually refer to?

Answer Source

The next object, presumably "this" is part of an array

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download