Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-24 09:51:28

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
0005 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
0006 
0007 // This file was modified by Oracle on 2015-2020.
0008 // Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
0009 
0010 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
0011 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0012 
0013 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
0014 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
0015 
0016 // Use, modification and distribution is subject to the Boost Software License,
0017 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0018 // http://www.boost.org/LICENSE_1_0.txt)
0019 
0020 #ifndef BOOST_GEOMETRY_UTIL_TRANSFORM_VARIANT_HPP
0021 #define BOOST_GEOMETRY_UTIL_TRANSFORM_VARIANT_HPP
0022 
0023 
0024 #include <boost/config/pragma_message.hpp>
0025 #if !defined(BOOST_ALLOW_DEPRECATED_HEADERS)
0026 BOOST_PRAGMA_MESSAGE("This header is deprecated.")
0027 #endif
0028 
0029 
0030 #include <boost/mpl/transform.hpp>
0031 #include <boost/variant/variant_fwd.hpp>
0032 
0033 
0034 namespace boost { namespace geometry
0035 {
0036 
0037 
0038 /*!
0039     \brief Meta-function that takes a Sequence type, an MPL lambda
0040         expression and an optional Inserter and returns a variant type over
0041         the same types as the initial variant type, each transformed using
0042         the lambda expression.
0043     \ingroup utility
0044     \par Example
0045     \code
0046         typedef boost::mpl::vector<int, float, long> types;
0047         typedef transform_variant<types, add_pointer<_> > transformed;
0048         typedef variant<int*, float*, long*> result;
0049         BOOST_MPL_ASSERT(( equal<result, transformed> ));
0050     \endcode
0051 */
0052 template <typename Sequence, typename Op, typename In = boost::mpl::na>
0053 struct transform_variant:
0054     make_variant_over<
0055         typename boost::mpl::transform<
0056             Sequence,
0057             Op,
0058             In
0059         >::type
0060     >
0061 {};
0062 
0063 
0064 /*!
0065     \brief Meta-function that takes a boost::variant type and an MPL lambda
0066         expression and returns a variant type over the same types as the
0067         initial variant type, each transformed using the lambda expression.
0068     \ingroup utility
0069     \par Example
0070     \code
0071         typedef variant<int, float, long> variant_type;
0072         typedef transform_variant<variant_type, add_pointer<_> > transformed;
0073         typedef variant<int*, float*, long*> result;
0074         BOOST_MPL_ASSERT(( equal<result, transformed> ));
0075     \endcode
0076 */
0077 template <BOOST_VARIANT_ENUM_PARAMS(typename T), typename Op>
0078 struct transform_variant<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Op, boost::mpl::na> :
0079     make_variant_over<
0080         typename boost::mpl::transform<
0081             typename variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types,
0082             Op
0083         >::type
0084     >
0085 {};
0086 
0087 
0088 }} // namespace boost::geometry
0089 
0090 
0091 #endif // BOOST_GEOMETRY_UTIL_TRANSFORM_VARIANT_HPP