Question.4
A developer creates semantic type aliases for safety:
using Voltage = int; using Current = int; void set_voltage(Voltage v); Current i = 500; set_voltage(i); // Pass Current to Voltage parameter
Does the compiler catch this mistake?
Select Answer
Yes -- Voltage and Current are different types
Voltage
Current
No -- type aliases do not create new types; both are just int, so the compiler sees no error
int
Yes -- but only with -Werror enabled
No -- but enum class would catch it
enum