1
General discussions / Re: Some last remarks
« on: April 04, 2012, 12:58:31 am »
Hi everybody,
Just to mention that once I had a "problem" with this design within a project using SFML. VC++ 2010 gave me a warning:
Because the only way to construct a sf::Thread with the current object is indeed to call its constructor with this in the initiazer list. However the code worked properly.
Perhaps would it be worth to add the possibility of setting this parameter after the object construction itself?
QuoteThread::Thread((void(C::*function)(), C *object)I want it to be clear enough that the pointer will be used later; with a reference I expect people to pass local instances and get undefined behaviours. Moreover, this overload will often be used inside classes, with "this".
The object parameter may not be NULL, thus it should be a reference, conforming to the general SFML style.
Just to mention that once I had a "problem" with this design within a project using SFML. VC++ 2010 gave me a warning:
Code: [Select]
warning C4355: 'this' : used in base member initializer list
Because the only way to construct a sf::Thread with the current object is indeed to call its constructor with this in the initiazer list. However the code worked properly.
Perhaps would it be worth to add the possibility of setting this parameter after the object construction itself?