has_tag.hpp 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Copyright 2003-2013 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/multi_index for library home page.
  7. */
  8. #ifndef BOOST_MULTI_INDEX_DETAIL_HAS_TAG_HPP
  9. #define BOOST_MULTI_INDEX_DETAIL_HAS_TAG_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
  14. #include <boost/mpl/contains.hpp>
  15. namespace boost{
  16. namespace multi_index{
  17. namespace detail{
  18. /* determines whether an index type has a given tag in its tag list */
  19. template<typename Tag>
  20. struct has_tag
  21. {
  22. template<typename Index>
  23. struct apply:mpl::contains<BOOST_DEDUCED_TYPENAME Index::tag_list,Tag>
  24. {
  25. };
  26. };
  27. } /* namespace multi_index::detail */
  28. } /* namespace multi_index */
  29. } /* namespace boost */
  30. #endif