pair_layout.hpp 1.4 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/pair_layout.hpp
  9. /// \brief Tags for pair layouts
  10. #ifndef BOOST_BIMAP_RELATION_PAIR_LAYOUT_HPP
  11. #define BOOST_BIMAP_RELATION_PAIR_LAYOUT_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. //@{
  20. /// \brief Tag for normal layout. ( A,B -> A,B )
  21. struct normal_layout {};
  22. /// \brief Tag for mirror layout. ( A,B -> B,A )
  23. struct mirror_layout {};
  24. //@}
  25. /** \struct boost::bimaps::relation::inverse_layout
  26. \brief Metafunction to obtain the inverse of a layout.
  27. \code
  28. template< class Layout >
  29. struct inverse_layout
  30. {
  31. typedef {InverseLayout} type;
  32. };
  33. \endcode
  34. See also normal_layout, mirror_layout.
  35. **/
  36. #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  37. template< class Layout >
  38. struct inverse_layout
  39. {
  40. typedef normal_layout type;
  41. };
  42. template<>
  43. struct inverse_layout< normal_layout >
  44. {
  45. typedef mirror_layout type;
  46. };
  47. #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  48. } // namespace relation
  49. } // namespace bimaps
  50. } // namespace boost
  51. #endif // BOOST_BIMAP_RELATION_DETAIL_PAIR_LAYOUT_HPP