Today at work I stumbled upon a very stupid mistake, over which he had lost a few precious minutes. Maybe there was nothing to brag but we brought to the attention. Would add to a module functor and I wanted to test it like this (pseudo code):
void Init() { Functor<CFoo> func(&mFoo, &CFoo::foo); myObj->SetFunctor(&func); } Imagine my surprise when later I wanted to call my functora, of course, beyond the method Init ()
I wonder what happened to the FUNC indicator, and for him after leaving the init?
On usprawidlenie I can say only that the platform on which it was written not use the visual debugger stuio and need an external debug tool and is quite "heavy".
Another thing that I want to mention is the difference in the speed performance of the pre-and post-increment. Once, in a book quite an old book I read to use pre increment instead of post-increment, and that supposedly is faster. To this day a colleague asked me to emphasize this in my code so I decided to check on the example of the compiler of Visual Studio 2008 Express. I made a simple example (1000x loop made with several mnożeniami and dodawaniami center) and with the help of a colleague who knows the assembler zdeassemblorawalismy it. And what it turned out? Both codes are identical
Maybe in some complex examples is an enormous difference but with the usual forums and inkrementacjach at today's compilers and processors, there is no difference (at least I think so
.






