is_tagged.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 tags/support/is_tagged.hpp
  9. /// \brief type_traits extension
  10. #ifndef BOOST_BIMAP_TAGS_SUPPORT_IS_TAGGED_HPP
  11. #define BOOST_BIMAP_TAGS_SUPPORT_IS_TAGGED_HPP
  12. #if defined(_MSC_VER)
  13. #pragma once
  14. #endif
  15. #include <boost/config.hpp>
  16. #include <boost/mpl/bool.hpp>
  17. #include <boost/bimap/tags/tagged.hpp>
  18. /** \struct boost::bimaps::tags::support::is_tagged
  19. \brief Type trait to check if a type is tagged.
  20. \code
  21. template< class Type >
  22. struct is_tagged
  23. {
  24. typedef {mpl::true_/mpl::false_} type;
  25. };
  26. \endcode
  27. See also tagged.
  28. **/
  29. #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  30. namespace boost {
  31. namespace bimaps {
  32. namespace tags {
  33. namespace support {
  34. // is_tagged metafunction
  35. template< class Type >
  36. struct is_tagged :
  37. ::boost::mpl::false_ {};
  38. template< class Type, class Tag >
  39. struct is_tagged< tagged< Type, Tag > > :
  40. ::boost::mpl::true_ {};
  41. } // namespace support
  42. } // namespace tags
  43. } // namespace bimaps
  44. } // namespace boost
  45. #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
  46. #endif // BOOST_BIMAP_TAGS_SUPPORT_IS_TAGGED_HPP