c++ - Is enum members type still implementation-dependent? -


i've read articles c++11 none of them mentioned whether implementation-dependent size of members of enum keeps unchanged.

  1. is still case?
  2. if yes, pratice use enum class token : int { ... }; explictly force compile make them of int type?

as per §7.2/5 of standard:

each enumeration has underlying type. underlying type can explicitly specified using enum-base; if not explicitly specified, underlying type of scoped enumeration type int.

(emphasis mine).

on matter (underlying type), standard not make difference whatsoever between enum , enum class/enum struct.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -