468,513 Members | 927 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

enum operator overloading in namespaces

Hey all. I posted this originally:

http://groups.google.com/group/comp....e4b76201ce17f1
I got the enums to work how I like but I am having a problem with the
overloading of the assignment operator:

namespace UserAffilliationType
{
enum UserAffilliationType //
user.getInfo.affiliations.affiliations_elt.type
{
collegeNetwork = 1,
highSchoolNetwork = 2,
workNetwork = 3,
geographyNetwork = 4
};
UserAffilliationType&
UserAffilliationType::operator=(UserAffilliationTy pe& lhs, const
QString &rhs);
}

When mingw32 trys to compile the overloading statment I get

In file included from kernel/FBNKernel_includes.h:22,
from fbNotify.h:27,
from fbNotify.cpp:18:
kernel/FBNKernelEnums.h:35: error:
`facebook::UserAffilliationType::UserAffilliationT ype&
facebook::UserAffilliationType
::operator=(facebook::UserAffilliationType::UserAf filliationType&,
const QString&)' must be a nonstatic member function
mingw32-make[1]: *** [release\fbNotify.o] Error 1

Any ideas on how I can get something like this to work?

MyUserAffilliationType = MyQString;

Oct 10 '06 #1
1 4024
I'm trying
class UserAffilliationType
{
enum { vals };
};

It works for the operator, but how do i refrence to the enum?
th**********@gmail.com wrote:
Hey all. I posted this originally:

http://groups.google.com/group/comp....e4b76201ce17f1
I got the enums to work how I like but I am having a problem with the
overloading of the assignment operator:

namespace UserAffilliationType
{
enum UserAffilliationType //
user.getInfo.affiliations.affiliations_elt.type
{
collegeNetwork = 1,
highSchoolNetwork = 2,
workNetwork = 3,
geographyNetwork = 4
};
UserAffilliationType&
UserAffilliationType::operator=(UserAffilliationTy pe& lhs, const
QString &rhs);
}

When mingw32 trys to compile the overloading statment I get

In file included from kernel/FBNKernel_includes.h:22,
from fbNotify.h:27,
from fbNotify.cpp:18:
kernel/FBNKernelEnums.h:35: error:
`facebook::UserAffilliationType::UserAffilliationT ype&
facebook::UserAffilliationType
::operator=(facebook::UserAffilliationType::UserAf filliationType&,
const QString&)' must be a nonstatic member function
mingw32-make[1]: *** [release\fbNotify.o] Error 1

Any ideas on how I can get something like this to work?

MyUserAffilliationType = MyQString;
Oct 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Nils Petter Vaskinn | last post: by
reply views Thread by Jonathan Mcdougall | last post: by
6 posts views Thread by PengYu.UT | last post: by
4 posts views Thread by John Salerno | last post: by
6 posts views Thread by TuxC0d3 | last post: by
34 posts views Thread by Steven Nagy | last post: by
11 posts views Thread by jakester | last post: by
10 posts views Thread by yu_kuo | last post: by
9 posts views Thread by Roger | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.