C++ Help: What's mean if(empty())?
by elvince · in Torque 3D Professional · 08/05/2010 (8:05 pm) · 5 replies
Maybe a odd question but what does mean:
I feel something has not been clean up, but as I'm not an expert in C++, this may be something useful.
Thanks
void GuiStackControl::stackFromBottom()
{
if( empty() )
return;I feel something has not been clean up, but as I'm not an expert in C++, this may be something useful.
Thanks
About the author
Recent Threads
#2
More it's used only on stackFromBottom and not stackFromTop by example.
08/05/2010 (8:46 pm)
I would have say that also. But look in the code there no empty function in the stackcontrol.More it's used only on stackFromBottom and not stackFromTop by example.
#3
08/05/2010 (8:52 pm)
It's possible that empty() is a method on a parent object - I'm guessing the GUI Container. I'm not at a computer that I have the T3D source on, and I'm not sure exactly what class it is, but that's certainly my best guess.
#4
The empty() function is defined on SimSet which the downlevel classes inherit. It is actually calling the empty() method on a SimObjectList owned by the SimSet.
08/05/2010 (9:02 pm)
SimSet->SimGroup->guiControl->guiStackControlThe empty() function is defined on SimSet which the downlevel classes inherit. It is actually calling the empty() method on a SimObjectList owned by the SimSet.
#5
so it might be useful to set this on all stackFromXXX function :D
08/06/2010 (6:38 am)
thanks I get it : bool empty() const { return objectList.empty(); }so it might be useful to set this on all stackFromXXX function :D
Torque 3D Owner Eric Armstrong
Bloody Tongue Games