member_at.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/member_at.hpp
  9. /// \brief Defines the tags for the member_at::side idiom
  10. #ifndef BOOST_BIMAP_RELATION_MEMBER_AT_HPP
  11. #define BOOST_BIMAP_RELATION_MEMBER_AT_HPP
  12. #if defined(_MSC_VER)
  13. #pragma once
  14. #endif
  15. #include <boost/config.hpp>
  16. namespace boost {
  17. namespace bimaps {
  18. namespace relation {
  19. /// \brief member_at::side idiom to access relation values and types using metaprogramming.
  20. /**
  21. This tags are used to specify which member you want to acces when using a metafunction over
  22. a symmetrical type. The idea is to be able to write code like:
  23. \code
  24. result_of::get<member_at::left,relation>::type data = get<member_at::left>(rel);
  25. \endcode
  26. The relation class supports this idiom even when the elements are tagged. This is useful
  27. because a user can decide to start tagging in any moment of the development.
  28. See also member_with_tag, is_tag_of_member_at_left, is_tag_of_member_at_right, get
  29. value_type_of, pair_by, pair_type_by.
  30. \ingroup relation_group
  31. **/
  32. namespace member_at {
  33. /// \brief Member at left tag
  34. /**
  35. See also member_at, rigth.
  36. **/
  37. struct left {};
  38. /// \brief Member at right tag
  39. /**
  40. See also member_at, left.
  41. **/
  42. struct right {};
  43. /// \brief Member info tag
  44. /**
  45. See also member_at, left, right.
  46. **/
  47. struct info {};
  48. }
  49. } // namespace relation
  50. } // namespace bimaps
  51. } // namespace boost
  52. #endif // BOOST_BIMAP_RELATION_MEMBER_AT_HPP