Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: asugix on July 21, 2012, 04:36:14 AM

Title: How to change CC on enum
Post by: asugix on July 21, 2012, 04:36:14 AM
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
Title: Re: How to change CC on enum
Post by: oBFusCATed on July 21, 2012, 09:48:52 AM
Currently this is a limitation of the CC and it supports only c++11 strong type like enums.
Title: Re: How to change CC on enum
Post by: asugix on July 22, 2012, 11:12:33 PM
well. The C++11 like enums is better anyway.  :-\
Title: Re: How to change CC on enum
Post by: oBFusCATed on July 22, 2012, 11:31:27 PM
If your project and compiler are c++11 ready, yes.