News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to change CC on enum

Started by asugix, July 21, 2012, 04:36:14 AM

Previous topic - Next topic

asugix

the source :

namespace osg {
class OSG_EXPORT CopyOp
{
  public:
    enum Options
    {
       SHALLOW_COPY =0,
       DEEP_COPY_OBJECTS = 1<<0,
       DEEP_COPY_NODES = 1<<1
    };
};
class myObj
{
   myObj(const CopyOp& copyop=CopyOp::SHALLOW_COPY);
};
}

Currently when I type new myObj(CopyOp::| )
There is no suggestion for enum values. But there is the suggestion for enum name.
So, by using aid of CC, I can make code like :

new myObj(CopyOp::Options.DEEP_COPY_OBJECTS);

This is work on C#, but not work for C++. How to make CC parse enum values after class name? so the aid like:

new myObj(CopyOp::DEEP_COPY_OBJECTS);


Thank you

oBFusCATed

Currently this is a limitation of the CC and it supports only c++11 strong type like enums.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

asugix

well. The C++11 like enums is better anyway.  :-\

oBFusCATed

If your project and compiler are c++11 ready, yes.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]