value_type_by.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 support/value_type_by.hpp
  9. /// \brief Metafunction to access the value types (std::pair compatibles) of a bimap
  10. #ifndef BOOST_BIMAP_SUPPORT_VALUE_TYPE_BY_HPP
  11. #define BOOST_BIMAP_SUPPORT_VALUE_TYPE_BY_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::support::value_type_by
  18. \brief Metafunction to obtain the value type of a bimap indexed by one of the sides.
  19. The tag parameter can be either a user defined tag or \c member_at::{side}.
  20. The returned type is signature-compatible with std::pair.
  21. \code
  22. template< class Tag, class Bimap >
  23. struct value_type_by
  24. {
  25. typedef typename Bimap::{side}_value_type type;
  26. };
  27. \endcode
  28. See also member_at.
  29. \ingroup bimap_group
  30. **/
  31. namespace boost {
  32. namespace bimaps {
  33. namespace support {
  34. // Implementation of value type by metafunction
  35. BOOST_BIMAP_SYMMETRIC_METADATA_ACCESS_BUILDER
  36. (
  37. value_type_by,
  38. left_value_type,
  39. right_value_type
  40. )
  41. } // namespace support
  42. } // namespace bimaps
  43. } // namespace boost
  44. #endif // BOOST_BIMAP_SUPPORT_VALUE_TYPE_BY_HPP