is_similar.hpp 910 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
  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. #ifndef BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP
  9. #define BOOST_GIL_EXTENSION_TOOLBOX_METAFUNCTIONS_IS_SIMILAR_HPP
  10. #include <boost/gil/channel.hpp>
  11. #include <type_traits>
  12. namespace boost{ namespace gil {
  13. /// is_similar metafunctions
  14. /// \brief Determines if two pixel types are similar.
  15. template<typename A, typename B>
  16. struct is_similar : std::false_type {};
  17. template<typename A>
  18. struct is_similar<A, A> : std::true_type {};
  19. template<typename B,int I, int S, bool M, int I2>
  20. struct is_similar
  21. <
  22. packed_channel_reference<B, I, S, M>,
  23. packed_channel_reference<B, I2, S, M>
  24. > : std::true_type {};
  25. }} // namespace boost::gil
  26. #endif