enum相当于定义一个常量,为何在iosbase中偏要在其外定义

Code:
  1. enum _Fmtflags   
  2. {   // constants for formatting options   
  3.     _Fmtmask = 0xffff, _Fmtzero = 0   
  4. };   
  5.   
  6. static const _Fmtflags skipws = (_Fmtflags)_IOSskipws;   
  7. static const _Fmtflags unitbuf = (_Fmtflags)_IOSunitbuf;   
  8. static const _Fmtflags uppercase = (_Fmtflags)_IOSuppercase;   
  9. static const _Fmtflags showbase = (_Fmtflags)_IOSshowbase;   
  10. static const _Fmtflags showpoint = (_Fmtflags)_IOSshowpoint;  

后面定义的都是_Fmtflags 何,要定义在外面,定义在里面不是很好吗?

你可能感兴趣的:(enum相当于定义一个常量,为何在iosbase中偏要在其外定义)