fork download
  1. struct Hash
  2. {
  3. template<typename MAC>
  4. std::size_t operator()(const MAC & mac) const
  5. {
  6. static_assert(sizeof(std::size_t) >= 6, "MAC address doesn't fit in std::size_t!");
  7. std::size_t key = 0;
  8. key |= size_t(mac[0]) << 64;
  9. key |= size_t(mac[1]) << 54;
  10. key |= size_t(mac[2]) << 44;
  11. key |= size_t(mac[3]) << 34;
  12. key |= size_t(mac[4]) << 24;
  13. key |= size_t(mac[5]) << 0;
  14. return key;
  15. }
  16. };
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6: warning: identifier ‘static_assert’ will become a keyword in C++0x
prog.cpp:4: error: expected constructor, destructor, or type conversion before ‘operator’
stdout
Standard output is empty