fork download
  1. #include <iostream>
  2.  
  3. struct struct_a
  4. {
  5. enum enum_a
  6. {
  7. value_1 = 123,
  8. value_2,
  9. value_3
  10. };
  11. };
  12.  
  13. struct struct_b
  14. {
  15. using enum_b = struct_a::enum_a;
  16. };
  17.  
  18. int main() {
  19. std::cout << "struct_a::enum_a = " << struct_a::enum_a::value_1 << std::endl;
  20. std::cout << "struct_b::enum_b = " << struct_b::enum_b::value_1 << std::endl;
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5520KB
stdin
Standard input is empty
stdout
struct_a::enum_a = 123
struct_b::enum_b = 123