unordered_set_support.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/property_map/property_map.hpp>
  17. #include <boost/bimap/unordered_set_of.hpp>
  18. #include <boost/bimap/support/data_type_by.hpp>
  19. #include <boost/bimap/support/key_type_by.hpp>
  20. #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  21. namespace boost {
  22. template< class Tag, class Bimap >
  23. struct property_traits< ::boost::bimaps::views::unordered_map_view<Tag,Bimap> >
  24. {
  25. typedef BOOST_DEDUCED_TYPENAME
  26. ::boost::bimaps::support::data_type_by<Tag,Bimap>::type value_type;
  27. typedef BOOST_DEDUCED_TYPENAME
  28. ::boost::bimaps::support:: key_type_by<Tag,Bimap>::type key_type;
  29. typedef readable_property_map_tag category;
  30. };
  31. template< class Tag, class Bimap >
  32. const BOOST_DEDUCED_TYPENAME ::boost::bimaps::support::data_type_by<Tag,Bimap>::type &
  33. get(const ::boost::bimaps::views::unordered_map_view<Tag,Bimap> & m,
  34. const BOOST_DEDUCED_TYPENAME
  35. ::boost::bimaps::support::key_type_by<Tag,Bimap>::type & key)
  36. {
  37. return m.at(key);
  38. }
  39. } // namespace boost
  40. #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  41. #endif // BOOST_BIMAP_PROPERTY_MAP_UNORDERED_SET_SUPPORT_HPP