over_sequence.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //-----------------------------------------------------------------------------
  2. // boost variant/detail/over_sequence.hpp header file
  3. // See http://www.boost.org for updates, documentation, and revision history.
  4. //-----------------------------------------------------------------------------
  5. //
  6. // Copyright (c) 2003
  7. // Eric Friedman
  8. //
  9. // Portions Copyright (C) 2002 David Abrahams
  10. //
  11. // Distributed under the Boost Software License, Version 1.0. (See
  12. // accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. #ifndef BOOST_VARIANT_DETAIL_OVER_SEQUENCE_HPP
  15. #define BOOST_VARIANT_DETAIL_OVER_SEQUENCE_HPP
  16. #include <boost/mpl/aux_/config/ctps.hpp>
  17. namespace boost {
  18. namespace detail { namespace variant {
  19. ///////////////////////////////////////////////////////////////////////////////
  20. // (detail) class over_sequence
  21. //
  22. // Wrapper used to indicate bounded types for variant are from type sequence.
  23. //
  24. template <typename Types>
  25. struct over_sequence
  26. {
  27. typedef Types type;
  28. };
  29. ///////////////////////////////////////////////////////////////////////////////
  30. // (detail) metafunction is_over_sequence (modeled on code by David Abrahams)
  31. //
  32. // Indicates whether the specified type is of form over_sequence<...> or not.
  33. //
  34. template <typename T>
  35. struct is_over_sequence
  36. : mpl::false_
  37. {
  38. };
  39. template <typename Types>
  40. struct is_over_sequence< over_sequence<Types> >
  41. : mpl::true_
  42. {
  43. };
  44. }} // namespace detail::variant
  45. } // namespace boost
  46. #endif // BOOST_VARIANT_DETAIL_OVER_SEQUENCE_HPP