Chris@102: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@102: Chris@102: // Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France. Chris@102: Chris@102: // This file was modified by Oracle on 2015. Chris@102: // Modifications copyright (c) 2015, Oracle and/or its affiliates. Chris@102: Chris@102: // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle Chris@102: Chris@102: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@102: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@102: Chris@102: // Use, modification and distribution is subject to the Boost Software License, Chris@102: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: #ifndef BOOST_GEOMETRY_UTIL_COMBINE_IF_HPP Chris@102: #define BOOST_GEOMETRY_UTIL_COMBINE_IF_HPP Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: Chris@102: namespace util Chris@102: { Chris@102: Chris@102: Chris@102: /*! Chris@102: \brief Meta-function to generate all the combination of pairs of types Chris@102: from a given sequence Sequence except those that does not satisfy the Chris@102: predicate Pred Chris@102: \ingroup utility Chris@102: \par Example Chris@102: \code Chris@102: typedef boost::mpl::vector, boost::mpl::int_<1> > types; Chris@102: typedef combine_if >::type combinations; Chris@102: typedef boost::mpl::vector< Chris@102: pair, boost::mpl::int_<1> >, Chris@102: pair, boost::mpl::int_<0> >, Chris@102: pair, boost::mpl::int_<1> >, Chris@102: pair, boost::mpl::int_<0> > Chris@102: > result_types; Chris@102: Chris@102: BOOST_MPL_ASSERT(( boost::mpl::equal )); Chris@102: \endcode Chris@102: */ Chris@102: template Chris@102: struct combine_if Chris@102: { Chris@102: struct combine Chris@102: { Chris@102: template Chris@102: struct apply Chris@102: { Chris@102: typedef typename boost::mpl::fold::type, Chris@102: T, Chris@102: boost::mpl::_2 Chris@102: >, Chris@102: boost::mpl::insert Chris@102: < Chris@102: boost::mpl::_1, boost::mpl::pair Chris@102: >, Chris@102: boost::mpl::_1 Chris@102: > Chris@102: >::type type; Chris@102: }; Chris@102: }; Chris@102: Chris@102: typedef typename boost::mpl::fold Chris@102: < Chris@102: Sequence1, boost::mpl::set0<>, combine Chris@102: >::type type; Chris@102: }; Chris@102: Chris@102: Chris@102: } // namespace util Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: #endif // BOOST_GEOMETRY_UTIL_COMBINE_IF_HPP