fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. namespace bla
  5. {
  6. enum Direction
  7. {
  8. dirA,
  9. dirB
  10. };
  11. }
  12.  
  13. namespace OtherNS
  14. {
  15. struct SomeStruct
  16. {
  17. using bla::Direction ;
  18.  
  19. Direction d;
  20.  
  21.  
  22. };
  23.  
  24. }
  25.  
  26. OtherNS::SomeStruct::Direction other = OtherNS::SomeStruct::dirB;
  27.  
  28. int main() {
  29. // your code goes here
  30. cout<<other<<"\n";
  31. return 0;
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:17:14: error: using-declaration for non-member at class scope
   using bla::Direction ;
              ^~~~~~~~~
prog.cpp:19:3: error: ‘Direction’ does not name a type
   Direction d;
   ^~~~~~~~~
prog.cpp:26:22: error: ‘Direction’ in ‘struct OtherNS::SomeStruct’ does not name a type
 OtherNS::SomeStruct::Direction other = OtherNS::SomeStruct::dirB;
                      ^~~~~~~~~
prog.cpp: In function ‘int main()’:
prog.cpp:30:8: error: ‘other’ was not declared in this scope
  cout<<other<<"\n";
        ^~~~~
stdout
Standard output is empty