A question for Mark Frohnmeyer.
by David Dougher · in Torque Game Engine · 05/02/2002 (10:23 am) · 2 replies
I was looking at the most recent compiles and I noticed the following warning...
c:\torque_clean\engine\sim\netconnection.cc(194) : warning C4355: 'this' : used in base member initializer list
Being a curious sort I went to the referenced function and saw that the function call was put together like so...
NetConnection::NetConnection(bool ghostFrom, bool ghostTo, bool sendEvents) : mStringTable(this)
{...
Feeling that this might not quite be kosher, I proceeded to check with a couple other programmers I know. The general consensus was that while this may currently work it depends on a very specific compiler interpretation and it may have portability issues with other compilers. I am curious as to why you chose to implement the function in this manner and I wonder if there was a cleaner, safer way that it could have been implemented.
c:\torque_clean\engine\sim\netconnection.cc(194) : warning C4355: 'this' : used in base member initializer list
Being a curious sort I went to the referenced function and saw that the function call was put together like so...
NetConnection::NetConnection(bool ghostFrom, bool ghostTo, bool sendEvents) : mStringTable(this)
{...
Feeling that this might not quite be kosher, I proceeded to check with a couple other programmers I know. The general consensus was that while this may currently work it depends on a very specific compiler interpretation and it may have portability issues with other compilers. I am curious as to why you chose to implement the function in this manner and I wonder if there was a cleaner, safer way that it could have been implemented.
About the author
Owner - Pariah Games, Adjunct Professor - Bristol Community College, Mentor - Game Design - Met School Newport, Mentor - Game Design - Met School Providence
#2
05/15/2002 (10:07 am)
Thanks for the feedback Mark! Lots to learn and it's nice to see the reasoning of the guys who built the system.
Associate Mark Frohnmayer