I am using visual studio 2017. In C++, I tried to assign a pointer to 'this' pointer. It showed compiler error as "assignment to 'this' (anachronism)". Anachronism means adding something into the period it can't exist like roman emperor checks computer. So is the compiler warning also like this. Or is there any specific meaning in coding for the word "anachronism"?.
A good while ago, this
pointer could be assigned values. I met such assignments in the code of the Cfront compiler. I wrote about it in this note: Celebrating the 30-th anniversary of the first C++ compiler: let's find the bugs in it. Examples:
expr.expr(TOK ba, Pexpr a, Pexpr b)
{
register Pexpr p;
if (this) goto ret;
....
this = p;
....
}
inline toknode.~toknode()
{
next = free_toks;
free_toks = this;
this = 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With