3 Forward declares `boost::hana::adjust`.
5 @copyright Louis Dionne 2013-2017
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_FWD_ADJUST_HPP
11 #define BOOST_HANA_FWD_ADJUST_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Apply a function on all the elements of a structure that compare
19 //! equal to some value.
20 //! @ingroup group-Functor
25 //! Given `F` a Functor and `U` a type that can be compared with `T`'s,
28 //! \mathtt{adjust} : F(T) \times U \times (T \to T) \to F(T)
32 //! The structure to adjust with `f`.
35 //! An object that is compared with each element `x` of the structure.
36 //! Elements of the structure that compare equal to `value` are adjusted
37 //! with the `f` function.
40 //! A function called as `f(x)` on the element(s) of the structure that
41 //! compare equal to `value`.
46 //! @include example/adjust.cpp
47 #ifdef BOOST_HANA_DOXYGEN_INVOKED
48 constexpr auto adjust = [](auto&& xs, auto&& value, auto&& f) {
49 return tag-dispatched;
52 template <typename Xs, typename = void>
53 struct adjust_impl : adjust_impl<Xs, when<true>> { };
56 template <typename Xs, typename Value, typename F>
57 constexpr auto operator()(Xs&& xs, Value&& value, F&& f) const;
60 constexpr adjust_t adjust{};
62 BOOST_HANA_NAMESPACE_END
64 #endif // !BOOST_HANA_FWD_ADJUST_HPP