Topic: embeded enums in friends


Author: dchiav01@scilab.uct.ac.za (yavor)
Date: 1997/08/12
Raw View
hello,

i've got the following code:

class SomeClass
{
public:
 enum MyType {type1, type2, type3};
 MyType object_type;  // an attribute
 friend void func(SomeClass& object);
};

void func(SomeClass& object)
{ object.object_type = SomeClass::MyType(type1); }

the compiler (i tried it on borland 3 and borland 4.5) gives me an error -
undefined symbol type1. i also tried without the typecast, but it still gives
me the same error.  what am i doing wrong?

regards
yavor
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]