enum { OFF, RED, YELLOW, GREEN } m_nState;把m_nState放在后面是什么意思?枚举类型可以这样吗?
《C++技术内幕》(第四版)第449页上的一个例子
class CTtest21Dlg : public CDialog
{
// Construction
public:
CTtest21Dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTtest21Dlg)
enum { IDD = IDD_DIALOG1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTtest21Dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTtest21Dlg)
//}}AFX_MSG
afx_msg void OnClickedRyg();
DECLARE_MESSAGE_MAP()
public:
enum { OFF, RED, YELLOW, GREEN } m_nState;
~~~~~~~~~~~~~~~~~~~~~~~
};