Jump to content

typeinfo() strange behaviour


photo

Recommended Posts

Hello.

 

class ToolBar
{
public:
	ToolBar()
	{
		//log.message("game: " + typeinfo(game) + "\n"); // this is an error: unknown token "game" in "game" expression
		log.message("this.game: " + typeinfo(this.game) + "\n"); // but this is work
	}
};

 

In main.cpp I have variable game, and typeinfo(this.game) is return address of this variable (I think).

In more complex project this line (log.message("this.game: " + typeinfo(this.game) + "\n")) cause crash of program (see image in attachment)

post-151-090237800 1289565648_thumb.jpg

Link to comment
×
×
  • Create New...