@naraku9333
I could not reproduce your problem at all on g++ 4.6.3. Nonetheless, I put the fix in. Hopefully it'll compile now!
@all
I uploaded another bug fix release, if anyone's interested. This one also features a performance enhancement which many of you on lower-end systems might like. Let that be the last of the 0.2.x series. :) http://sourceforge.net/projects/soundbench/files/0.2.3%20Alpha/
Thank you so much for your help!
-Albatross
EDIT: I didn't even notice. 3500 posts and counting.
It's pretty obvious what it means. I am generally in favour of explicitness, but I don't think it matters in this case.
... in this case, the check is as useless as it is for delete.
In other cases, without such a rich context, an "explicit" check would at least make it obvious what's a pointer and what isn't.
In other cases, without such a rich context, an "explicit" check would at least make it obvious what's a pointer and what isn't.
If you don't know whether what is being checked is a pointer or a boolean, then you likely named it poorly.
What do you do in the standard case when you have a smart pointer instead of a raw pointer?
Do you seriously advocate writing if (ptr.get()!=nullptr)
instead of if (ptr)
?
1) The code is supposed to show that C++11 provides overloaded operators for smart pointers to be compared to among other things nullptr.
2) The reference to std::auto_ptr being deprecated is supposed to remind Athar that std::auto_ptr is deprecated and probably with good reason as his example hints how limited it is if you need to retrieve a bare pointer but he also compared it to nullptr which is from C++11 and not C++03 so I wanted to remind him that std::auto_ptr is deprecated and in C++11 you also have the overloaded operators which allow you to directly compare a smart pointer to nullptr.
I sense a bit of hostility. All I'm saying is, I personally consider it to be good practice to usually compare things to values from their own domain of values (e.g. 0, NULL, nullptr) so as to get a "real" boolean expression. Bare bool variables should be excepted from this. Comparing to true or false would be silly.
For me, it's the same principle why I don't usually do things like if (!size).
I am aware that generally the == nullptr is redundant. However, it does make it a lot easier to find bugs and read the code, especially considering how I use null pointers.
I do use null pointers as dummies quite often in my code, a large reason being to avoid using unnecessary memory when a user wishes not to use a certain feature (i.e. a sound generator). I know I could create dummy classes and that it would probably be a bit more kosher, but... it seems like a bit of a waste to me. :/
EDIT @Moschops: You can still clone it. And... what chrisname said. :)
I'd been thinking about replacing the graphics for most of the UI elements with graphics that are a little bit less... dull. That little bit of shininess does draw attention and makes the program a bit nicer to look at.