Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@16: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@16: Chris@16: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@16: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. 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_UTIL_ADD_CONST_IF_C_HPP Chris@16: #define BOOST_GEOMETRY_UTIL_ADD_CONST_IF_C_HPP Chris@16: Chris@16: Chris@16: #include Chris@16: Chris@16: Chris@16: namespace boost { namespace geometry Chris@16: { Chris@16: Chris@16: Chris@16: /*! Chris@16: \brief Meta-function to define a const or non const type Chris@16: \ingroup utility Chris@16: \details If the boolean template parameter is true, the type parameter Chris@16: will be defined as const, otherwise it will be defined as it was. Chris@16: This meta-function is used to have one implementation for both Chris@16: const and non const references Chris@16: \note This traits class is completely independant from Boost.Geometry Chris@16: and might be a separate addition to Boost Chris@16: \note Used in a.o. for_each, interior_rings, exterior_ring Chris@16: \par Example Chris@16: \code Chris@16: void foo(typename add_const_if_c::type& point) Chris@16: \endcode Chris@16: */ Chris@16: template Chris@16: struct add_const_if_c Chris@16: { Chris@16: typedef typename boost::mpl::if_c Chris@16: < Chris@16: IsConst, Chris@16: Type const, Chris@16: Type Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: Chris@16: Chris@16: }} // namespace boost::geometry Chris@16: Chris@16: Chris@16: #endif // BOOST_GEOMETRY_UTIL_ADD_CONST_IF_C_HPP