fork download
  1. #include <array>
  2. #include <cstdint>
  3.  
  4. struct SessionKey {
  5. SessionKey(const std::array<uint8_t, 6> & inMAC, uint16_t inEtherType) :
  6. mMAC(inMAC),
  7. mEtherType(inEtherType)
  8. {
  9. }
  10.  
  11. union {
  12. struct {
  13. std::array<uint8_t, 6> mMAC;
  14. uint16_t mEtherType;
  15. };
  16. uint64_t mValue;
  17. };
  18.  
  19. friend bool operator==(const SessionKey & lhs, const SessionKey & rhs)
  20. { return lhs.mValue == rhs.mValue; }
  21.  
  22. friend bool operator<(const SessionKey & lhs, const SessionKey & rhs)
  23. { return lhs.mValue < rhs.mValue; }
  24. };
  25.  
  26.  
  27. int main()
  28. {
  29. std::map<SessionKey, int> test;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:29:2: error: 'map' is not a member of 'std'
prog.cpp:29:21: error: expected primary-expression before ',' token
prog.cpp:29:23: error: expected primary-expression before 'int'
prog.cpp:29:23: error: expected ';' before 'int'
stdout
Standard output is empty