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

Similar Threads

Approach to sin_zero 13
Marshalling asymmetry 8
Qsort() is messing with my entire Code!!! 0
OT: optimization question 1
Can't think of a good subject 15
Refactoring question 14
segmented_array question 2
Move rules 2

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top