unordered_set_support.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Boost.Bimap
  2. //
  3. // Copyright (c) 2006-2007 Matias Capeletto
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. /// \file property_map/unordered_set_support.hpp
  9. /// \brief Support for the property map concept.
  10. #ifndef BOOST_BIMAP_PROPERTY_MAP_UNORDERED_SET_SUPPORT_HPP
  11. #define BOOST_BIMAP_PROPERTY_MAP_UNORDERED_SET_SUPPORT_HPP
  12. #if defined(_MSC_VER)
  13. #pragma once
  14. #endif
  15. #include <boost/config.hpp>
  16. #include <boost/bimap/unordered_set_of.hpp>
  17. #include <boost/bimap/support/data_type_by.hpp>
  18. #include <boost/bimap/support/key_type_by.hpp>
  19. #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  20. namespace boost {
  21. template <typename PA> struct property_traits;
  22. struct readable_property_map_tag;
  23. template< class Tag, class Bimap >
  24. struct property_traits< ::boost::bimaps::views::unordered_map_view<Tag,Bimap> >
  25. {
  26. typedef BOOST_DEDUCED_TYPENAME
  27. ::boost::bimaps::support::data_type_by<Tag,Bimap>::type value_type;
  28. typedef BOOST_DEDUCED_TYPENAME
  29. ::boost::bimaps::support:: key_type_by<Tag,Bimap>::type key_type;
  30. typedef readable_property_map_tag category;
  31. };
  32. template< class Tag, class Bimap >
  33. const BOOST_DEDUCED_TYPENAME ::boost::bimaps::support::data_type_by<Tag,Bimap>::type &
  34. get(const ::boost::bimaps::views::unordered_map_view<Tag,Bimap> & m,
  35. const BOOST_DEDUCED_TYPENAME
  36. ::boost::bimaps::support::key_type_by<Tag,Bimap>::type & key)
  37. {
  38. return m.at(key);
  39. }
  40. } // namespace boost
  41. #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  42. #endif // BOOST_BIMAP_PROPERTY_MAP_UNORDERED_SET_SUPPORT_HPP