template.cpp 515 B

123456789101112131415161718
  1. // Copyright 2012 Daniel James.
  2. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include "template.hpp"
  5. #include <cassert>
  6. #include <boost/unordered_set.hpp>
  7. int main()
  8. {
  9. typedef my_pair<int, float> pair;
  10. boost::unordered_set<pair> pair_set;
  11. pair_set.emplace(10, 0.5f);
  12. assert(pair_set.find(pair(10, 0.5f)) != pair_set.end());
  13. assert(pair_set.find(pair(10, 0.6f)) == pair_set.end());
  14. }