One:
Some people and I were talking in IRC about infinite loops, and we go into sort of an argument over: while(1) vs. for(;;). Does GCC optimize both of those? I've heard MSVC++ does.
Two:
What is the logic behind for(;;)? A particular user told me that while(1) wouldn't make sense to people, and my question was how does "for(;;)"? I would think if someone left the condition block of the for block blank, that it would be treated as false, and the loop would never execute, but w/e (NULL condition, NULL is 0, 0 is false).
Three:
Is this supposed to work? const &void = ...
(and, what's the point of it if it's legal)
Four:
Is this a good way to determine if a variable is of a certian type? I'm a bit worried about classes and inheritance with this method (I came up with the code myself, hence why it scares me -_-):
from .h file (i'm not gonna waste time creating a cpp file for the implementation details when they're either return true or false...)
template
class type_comparer
{
public:
static bool is_type(const matchtype var)
{
return true;
}
template
static bool is_type(const nottype var)
{
return false;
}
private:
type_comparer(void) {};
};
#define istype(type,variable) type_comparer::is_type(variable)