Page 2 of 2

Re: Stuck on balls bouncing off walls

Posted: May 8th, 2017, 2:13 am
by albinopapa
Yeah, between the : and {} is called the initializer list and when you construct an object, such as a RectF, the memory that is allocated for the object is filled immediately with that data before the function body {} of the constructor is even called, so it's more efficient if you can get away with it.

I might have mentioned all this on the thread I posted, but there are instances where you won't be able to use the initializer list.

Re: Stuck on balls bouncing off walls

Posted: May 8th, 2017, 5:08 am
by migueltherat
I think you did mention it on the other thread, but it helps to have it worded again. Thanks. I guess earlier I had been under the impression that you only did that colon thing on the very first constructor for a class.