Chris@16: // Boost.Geometry Index Chris@16: // Chris@16: // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. Chris@16: // Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_INDEX_DETAIL_TRANSLATOR_HPP Chris@16: #define BOOST_GEOMETRY_INDEX_DETAIL_TRANSLATOR_HPP Chris@16: Chris@16: namespace boost { namespace geometry { namespace index { Chris@16: Chris@16: namespace detail { Chris@16: Chris@16: template Chris@16: struct translator Chris@16: : public IndexableGetter Chris@16: , public EqualTo Chris@16: { Chris@16: typedef typename IndexableGetter::result_type result_type; Chris@16: Chris@16: translator(IndexableGetter const& i, EqualTo const& e) Chris@16: : IndexableGetter(i), EqualTo(e) Chris@16: {} Chris@16: Chris@16: template Chris@16: result_type operator()(Value const& value) const Chris@16: { Chris@16: return IndexableGetter::operator()(value); Chris@16: } Chris@16: Chris@16: template Chris@16: bool equals(Value const& v1, Value const& v2) const Chris@16: { Chris@16: return EqualTo::operator()(v1, v2); Chris@16: } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct result_type Chris@16: { Chris@16: typedef typename IndexableGetter::result_type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct indexable_type Chris@16: { Chris@16: typedef typename boost::remove_const< Chris@16: typename boost::remove_reference< Chris@16: typename result_type::type Chris@16: >::type Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: } // namespace detail Chris@16: Chris@16: }}} // namespace boost::geometry::index Chris@16: Chris@16: #endif // BOOST_GEOMETRY_INDEX_DETAIL_TRANSLATOR_HPP