Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > enum operator overloading in namespaces

Reply
Thread Tools

enum operator overloading in namespaces

 
 
thetrueaplus@gmail.com
Guest
Posts: n/a
 
      10-10-2006
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:perator=(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
:perator=(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;

 
Reply With Quote
 
 
 
 
thetrueaplus@gmail.com
Guest
Posts: n/a
 
      10-10-2006
I'm trying
class UserAffilliationType
{
enum { vals };
};

It works for the operator, but how do i refrence to the enum?


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:perator=(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
> :perator=(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;


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Reusable" operator overloading for enum? nick C++ 21 12-30-2009 08:48 PM
user defined conversion operator or operator overloading? hurcan solter C++ 3 08-29-2007 07:39 PM
Why is overloading operator. (member operator) forbidden? dascandy@gmail.com C++ 11 05-16-2007 07:54 PM
namespaces, linkage error, operator overloading jakester C++ 11 04-16-2007 08:05 AM
Operator overloading on "default" operator John Smith C++ 2 10-06-2004 10:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57