generate_view_binder.hpp 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 detail/generate_view_binder.hpp
  9. /// \brief Define macros to help building the set type of definitions
  10. #ifndef BOOST_BIMAP_DETAIL_GENERATE_VIEW_BINDER_HPP
  11. #define BOOST_BIMAP_DETAIL_GENERATE_VIEW_BINDER_HPP
  12. #if defined(_MSC_VER)
  13. #pragma once
  14. #endif
  15. #include <boost/config.hpp>
  16. #include <boost/multi_index/tag.hpp>
  17. /*===========================================================================*/
  18. #define BOOST_BIMAP_GENERATE_MAP_VIEW_BINDER( \
  19. \
  20. MAP_VIEW_TYPE \
  21. \
  22. ) \
  23. \
  24. template< class Tag, class BimapType > \
  25. struct map_view_bind \
  26. { \
  27. typedef MAP_VIEW_TYPE \
  28. < \
  29. Tag, \
  30. BimapType \
  31. \
  32. > type; \
  33. };
  34. /*===========================================================================*/
  35. /*===========================================================================*/
  36. #define BOOST_BIMAP_GENERATE_SET_VIEW_BINDER( \
  37. \
  38. SET_VIEW_TYPE \
  39. \
  40. ) \
  41. \
  42. template< class IndexType > \
  43. struct set_view_bind \
  44. { \
  45. typedef SET_VIEW_TYPE<IndexType> type; \
  46. };
  47. /*===========================================================================*/
  48. #endif // BOOST_BIMAP_DETAIL_GENERATE_VIEW_BINDER_HPP