g++ test.cpp -ansi -pedantic -o test.exe
test.cpp: In function `int main()':
test.cpp:22: case label does not reduce to an integer constant
Why won't "operator unsigned int() const" do its job in this... case?!
class Blah
{
private:
unsigned int k;
public:
operator unsigned int() const
{
return k;
}
};
int main()
{
Blah aaa;
Blah bbb;
switch (aaa)
{
case bbb:
;
}
}
-JKop