Boost GIL


apply_operation.hpp
1//
2// Copyright 2005-2007 Adobe Systems Incorporated
3//
4// Distributed under the Boost Software License, Version 1.0
5// See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt
7//
8#ifndef BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP
9#define BOOST_GIL_EXTENSION_DYNAMIC_IMAGE_APPLY_OPERATION_HPP
10
11#include <boost/variant2/variant.hpp>
12
13namespace boost { namespace gil {
14
17template <typename Variant1, typename Visitor>
18[[deprecated("Use variant2::visit instead.")]]
19BOOST_FORCEINLINE
20auto apply_operation(Variant1&& arg1, Visitor&& op)
21#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
22 -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1)))
23#endif
24{
25 return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1));
26}
27
30template <typename Variant1, typename Variant2, typename Visitor>
31[[deprecated("Use variant2::visit instead.")]]
32BOOST_FORCEINLINE
33auto apply_operation(Variant1&& arg1, Variant2&& arg2, Visitor&& op)
34#if defined(BOOST_NO_CXX14_DECLTYPE_AUTO) || defined(BOOST_NO_CXX11_DECLTYPE_N3276)
35 -> decltype(variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2)))
36#endif
37{
38 return variant2::visit(std::forward<Visitor>(op), std::forward<Variant1>(arg1), std::forward<Variant2>(arg2));
39}
40
41}} // namespace boost::gil
42
43#endif
BOOST_FORCEINLINE auto apply_operation(Variant1 &&arg1, Visitor &&op)
Applies the visitor op to the variants.
Definition apply_operation.hpp:20
defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
Definition algorithm.hpp:36