Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / gil / extension / toolbox / metafunctions / is_similar.hpp
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
11 #include <boost/gil/channel.hpp>
12
13 #include <type_traits>
14
15 namespace boost{ namespace gil {
16
17 /// is_similar metafunctions
18 /// \brief Determines if two pixel types are similar.
19
20 template<typename A, typename B>
21 struct is_similar : std::false_type {};
22
23 template<typename A>
24 struct is_similar<A, A> : std::true_type {};
25
26 template<typename B,int I, int S, bool M, int I2>
27 struct is_similar
28     <
29         packed_channel_reference<B,  I, S, M>,
30         packed_channel_reference<B, I2, S, M>
31     > : std::true_type {};
32
33 }} // namespace boost::gil
34
35 #endif