is_vector_type.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #ifndef BOOST_COMPUTE_TYPE_TRAITS_IS_VECTOR_TYPE_HPP
  11. #define BOOST_COMPUTE_TYPE_TRAITS_IS_VECTOR_TYPE_HPP
  12. #include <boost/mpl/bool.hpp>
  13. #include <boost/compute/type_traits/vector_size.hpp>
  14. namespace boost {
  15. namespace compute {
  16. /// Meta-function returning \c true if \p T is a vector type.
  17. ///
  18. /// For example,
  19. /// \code
  20. /// is_vector_type<int>::value == false
  21. /// is_vector_type<float4_>::value == true
  22. /// \endcode
  23. ///
  24. /// \see make_vector_type, vector_size
  25. template<class T>
  26. struct is_vector_type : boost::mpl::bool_<vector_size<T>::value != 1>
  27. {
  28. };
  29. } // end compute namespace
  30. } // end boost namespace
  31. #endif // BOOST_COMPUTE_TYPE_TRAITS_IS_VECTOR_TYPE_HPP