Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1.     template <typename Ty1, typename Ty2>
  2.     struct duplex
  3.     {
  4.         Ty1 first;
  5.         Ty2 second;
  6.  
  7.         bool operator==(const duplex<Ty1, Ty2>& dup) const
  8.         {
  9.             return (first == dup.first
  10.                 && second == dup.second);
  11.         }
  12.     };
  13.  
  14.     template <typename Ty1, typename Ty2>
  15.     struct std::hash<lwlog::details::duplex<Ty1, Ty2>>
  16.     {
  17.         std::size_t operator()(const lwlog::details::duplex<Ty1, Ty2>& dup) const
  18.         {
  19.             return std::hash<Ty1>{}(dup.first) ^ std::hash<Ty2>{}(dup.second);
  20.         }
  21.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement