value_type_of.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 relation/support/value_type_of.hpp
  9. /// \brief value_type_of<tag,relation> metafunction
  10. #ifndef BOOST_BIMAP_RELATION_SUPPORT_VALUE_TYPE_OF_HPP
  11. #define BOOST_BIMAP_RELATION_SUPPORT_VALUE_TYPE_OF_HPP
  12. #if defined(_MSC_VER)
  13. #pragma once
  14. #endif
  15. #include <boost/config.hpp>
  16. #include <boost/bimap/relation/detail/metadata_access_builder.hpp>
  17. /** \struct boost::bimaps::relation::support::value_type_of
  18. \brief Metafunction to obtain the value type of one of the sides.
  19. \code
  20. template< class Tag, class Relation >
  21. struct value_type_of
  22. {
  23. typedef typename Relation::{side}_type type;
  24. };
  25. \endcode
  26. See also member_at, get().
  27. \ingroup relation_group
  28. **/
  29. namespace boost {
  30. namespace bimaps {
  31. namespace relation {
  32. namespace support {
  33. // Metafunction value_type_of
  34. /*
  35. template< class Tag, class Relation >
  36. struct value_type_of
  37. {
  38. typedef -unspecified- type;
  39. };
  40. */
  41. BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
  42. (
  43. value_type_of,
  44. left_value_type,
  45. right_value_type
  46. )
  47. // Add support for info tags to value_type_of
  48. template< class Tag, class SymmetricType >
  49. struct value_type_of
  50. <
  51. Tag, SymmetricType,
  52. BOOST_DEDUCED_TYPENAME enable_if
  53. <
  54. ::boost::bimaps::relation::support::is_tag_of_member_at_info
  55. <
  56. Tag,
  57. SymmetricType
  58. >
  59. >::type
  60. >
  61. {
  62. typedef BOOST_DEDUCED_TYPENAME SymmetricType::info_type type;
  63. };
  64. } // namespace support
  65. } // namespace relation
  66. } // namespace bimaps
  67. } // namespace boost
  68. #endif // BOOST_BIMAP_RELATION_SUPPORT_VALUE_TYPE_OF_HPP