Scoped enum question

W

woodbrian77

I like this, but I might not be able to use it.

With an enum class I could tell a user to forward declare
it and that I'd create the enum class for them.

enum class cmw_user_input_data_member_flags : std::uint8_t;

struct cmw_user_input
{
cmw_user_input_data_member_flags marshalling_bits;
// ...
};

I think that works because the compiler knows the size of
the enum class.

Can I do that with the class you've described?
 
L

Luca Risolia

enum class cmw_user_input_data_member_flags : std::uint8_t;
struct cmw_user_input
{
cmw_user_input_data_member_flags marshalling_bits;
// ...
};
Can I do that with the class you've described?

No. But you can have the definition of type
cmw_user_input_data_member_flags in a separate
header file that the user can include in her program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,930
Messages
2,570,072
Members
46,521
Latest member
JamieCooch

Latest Threads

Top