// // Copyright 2005-2007 Adobe Systems Incorporated // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // #ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP #define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP #include #include #ifdef BOOST_GIL_DOXYGEN_ONLY #undef BOOST_GIL_REDUCE_CODE_BLOAT #endif // Implements apply_operation for variants. // Optionally performs type reduction. #ifdef BOOST_GIL_REDUCE_CODE_BLOAT #include #else namespace boost { namespace gil { /// \ingroup Variant /// \brief Invokes a generic mutable operation (represented as a unary function object) on a variant template BOOST_FORCEINLINE auto apply_operation(variant& arg, UnaryOp op) #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276) -> typename UnaryOp::result_type #endif { return apply_visitor(op, arg); } /// \ingroup Variant /// \brief Invokes a generic constant operation (represented as a unary function object) on a variant template BOOST_FORCEINLINE auto apply_operation(variant const& arg, UnaryOp op) #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276) -> typename UnaryOp::result_type #endif { return apply_visitor(op, arg); } /// \ingroup Variant /// \brief Invokes a generic constant operation (represented as a binary function object) on two variants template BOOST_FORCEINLINE auto apply_operation( variant const& arg1, variant const& arg2, BinaryOp op) #if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276) -> typename BinaryOp::result_type #endif { return apply_visitor(op, arg1, arg2); } }} // namespace boost::gil #endif // defined(BOOST_GIL_REDUCE_CODE_BLOAT) #endif