enum operator overloading in namespaces

Discussion in 'C++' started by thetrueaplus@gmail.com, Oct 10, 2006.

  1. Guest

    Hey all. I posted this originally:

    http://groups.google.com/group/comp.lang.c /browse_thread/thread/b1e4b76201ce17f1


    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::eek:perator=(UserAffilliationType& 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::UserAffilliationType&
    facebook::UserAffilliationType
    ::eek:perator=(facebook::UserAffilliationType::UserAffilliationType&,
    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, 2006
    #1
    1. Advertising

  2. Guest

    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.lang.c /browse_thread/thread/b1e4b76201ce17f1
    >
    >
    > 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::eek:perator=(UserAffilliationType& 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::UserAffilliationType&
    > facebook::UserAffilliationType
    > ::eek:perator=(facebook::UserAffilliationType::UserAffilliationType&,
    > 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, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith
    Replies:
    2
    Views:
    441
    Ivan Vecerina
    Oct 6, 2004
  2. jakester
    Replies:
    11
    Views:
    593
    James Kanze
    Apr 16, 2007
  3. Replies:
    11
    Views:
    759
    James Kanze
    May 16, 2007
  4. hurcan solter
    Replies:
    3
    Views:
    748
    Cholo Lennon
    Aug 29, 2007
  5. nick
    Replies:
    21
    Views:
    1,373
    James Kanze
    Dec 30, 2009
Loading...

Share This Page