J
JKop
G++ gives the most un-informative, cryptic, BULLSHIT errors
statements.
I'm writing a program at the moment and I have to finish it
real soon. The problem I'm having is illustrated in the
following:
class Blah
{
private:
int k;
public:
operator int()
{
return k;
}
};
int main()
{
Blah const poo;
switch (poo)
{
case 1:
;
}
}
The yokie that goes in a switch statement has to be an
integral type. My class has an "operator int()". Grand.
Note that the "poo" object is const. If I make the poo
object non-const, then the above code compiles. BUT WHAT
THE HELL DIFFERENCE DOES IT MAKE IF IT'S CONST!
Some enlightenment please,
-JKop
statements.
I'm writing a program at the moment and I have to finish it
real soon. The problem I'm having is illustrated in the
following:
class Blah
{
private:
int k;
public:
operator int()
{
return k;
}
};
int main()
{
Blah const poo;
switch (poo)
{
case 1:
;
}
}
The yokie that goes in a switch statement has to be an
integral type. My class has an "operator int()". Grand.
Note that the "poo" object is const. If I make the poo
object non-const, then the above code compiles. BUT WHAT
THE HELL DIFFERENCE DOES IT MAKE IF IT'S CONST!
Some enlightenment please,
-JKop