vendredi 29 mai 2015

How can i declare enum variable inside a class using forward declaration

The following declaration syntax doesn't work inside a class, but it is acceptable for "outside class" declaration according to c++11. Could you give me some advices how can i implement such a logic if it possible of course.

class A
{
    private:

    enum class colors : unsigned char;

    colors c;

    public:

    A()
    {

    }

    virtual ~A()
    {

    }

    private:

    enum class colors : unsigned char
    {
        red,
        blue,
        green
    };
};

Aucun commentaire:

Enregistrer un commentaire