There are sort of two related questions here:
A) How is enum implemented? For example, if I have the code:
enum myType
{
TYPE_1,
TYPE_2
};
What is actually happening? I know that you can treat TYPE_1 and TYPE_2 as ints, but are they actually just ints?
B) Based on that information, assuming that the enum passed in didn't need to be changed, would it make more sense to pass myType into a function as a value or as a const reference?
For example, which is the better choice:
void myFunction(myType x){ // some stuff }
or
void myFunction(const myType& x) { // some stuff }