visual-studiovisual-c++enum-class

Is there an accepted way to adjust this so that all of my `enum class` elements are grouped together in the ClassView?


Old code:

typedef enum tagUndoAction { UNDO_CHANGE_CELL = 0,
                             UNDO_CHANGE_SELECTION_START,
                             UNDO_CHANGE_SELECTION_SUB } UNDO_ACTION_E;

New code:

enum class UndoAction { ChangeCell = 0,
                        ChangeSelectionStart,
                        ChangeSelectionSub } ;

In ClassView:

enter image description here

What I liked about the previous approach was that all of the enumerations were listed together in the ClassView. Now they are displayed A - Z fashion with all the classes.

Is there an accepted way to adjust this so that all of my enum class elements are grouped together in the ClassView?


Solution

  • I guess this is down to personal taste but I have settled on a comporomise of several methods:

    1. I have moved some enum class definitions to inside the class that uses it the most.
    2. For others I have moved them into a AppEnums namespace.

    This works for me.