1 // Boost.Geometry (aka GGL, Generic Geometry Library) 2 3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. 4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. 5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. 6 7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library 8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. 9 10 // Use, modification and distribution is subject to the Boost Software License, 11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 12 // http://www.boost.org/LICENSE_1_0.txt) 13 14 15 #ifndef BOOST_GEOMETRY_CORE_REVERSE_DISPATCH_HPP 16 #define BOOST_GEOMETRY_CORE_REVERSE_DISPATCH_HPP 17 18 19 #include <cstddef> 20 21 #include <boost/mpl/if.hpp> 22 #include <boost/type_traits/integral_constant.hpp> 23 24 #include <boost/geometry/core/geometry_id.hpp> 25 26 27 namespace boost { namespace geometry 28 { 29 30 31 #ifndef DOXYGEN_NO_DETAIL 32 namespace detail 33 { 34 35 // Different geometries: reverse_dispatch if second ID < first ID 36 template <std::size_t GeometryId1, std::size_t GeometryId2> 37 struct reverse_dispatch : boost::mpl::if_c 38 < 39 (GeometryId1 > GeometryId2), 40 boost::true_type, 41 boost::false_type 42 > 43 {}; 44 45 46 // Same geometry: never reverse_dispatch 47 template <std::size_t GeometryId> 48 struct reverse_dispatch<GeometryId, GeometryId> : boost::false_type {}; 49 50 51 } // namespace detail 52 #endif // DOXYGEN_NO_DETAIL 53 54 55 template <typename Geometry1, typename Geometry2> 56 struct reverse_dispatch : detail::reverse_dispatch 57 < 58 geometry_id<Geometry1>::type::value, 59 geometry_id<Geometry2>::type::value 60 > 61 {}; 62 63 64 }} // namespace boost::geometry 65 66 #endif // BOOST_GEOMETRY_CORE_REVERSE_DISPATCH_HPP 67