I have in my class definition the following enum:
static class Myclass {
...
public:
enum encoding { BINARY, ASCII, ALNUM, NUM };
Myclass(Myclass::encoding);
...
}
Then in the method definition:
Myclass::Myclass(Myclass::encoding enc) {
...
}
This doesn't work, but what am I doing wrong? How do I pass an enum member correctly, that is defined inside a class for member methods (and other methods as well)?
I'm not entirely sure why you're using "static class" here. This boilerplate works just fine for me in VS2010:
class CFoo
{
public:
enum Bar { baz, morp, bleep };
CFoo(Bar);
};
CFoo::CFoo(Bar barIn)
{
barIn;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With