Click here to Skip to main content
15,867,330 members

Comments by Nuri Ismail (Top 200 by date)

Nuri Ismail 13-Dec-11 5:14am View    
Deleted
Reason for my vote of 5
Very nice tip! :)
Nuri Ismail 9-Aug-11 9:58am View    
Deleted
Oh yes, I will... :)
Nuri Ismail 9-Aug-11 9:45am View    
Deleted
'How do you think could it be hit on performance?'
Actually I have no idea. I suspect there should not be a serious difference in performance compared to 'memset' but at the end it will depend on compiler implementation.
The performance side is interesting though, I'll make some test in my spare time to see if there will be significant hits on performance. Thanks for the idea. :)

BTW: Maybe you know this, but it's important to note that this kind of initialization (with empty parentheses) is not specific for dynamic arrays and it can be useful in other situations (I've omitted this fact in my original post because the context was dynamic arrays related).
You can have a look at this useful thread as a further reference:

http://stackoverflow.com/questions/620137/do-the-parentheses-after-the-type-name-make-a-difference-with-new

Nuri Ismail 9-Aug-11 9:08am View    
Deleted
Yes, it is part of C++03.
You can try it and it should work with standard conforming C++ compilers.
The disadvantage of this syntax is that it's not compatible with older compilers like VC6 for example.
Nuri Ismail 9-Aug-11 9:05am View    
Deleted
Thank you very much Alok. I'm glad you like it! :)