|
|
|||
File indexing completed on 2025-12-15 09:53:03
0001 /*! 0002 @file 0003 Forward declares `boost::hana::adjust`. 0004 0005 Copyright Louis Dionne 2013-2022 0006 Distributed under the Boost Software License, Version 1.0. 0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 0008 */ 0009 0010 #ifndef BOOST_HANA_FWD_ADJUST_HPP 0011 #define BOOST_HANA_FWD_ADJUST_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 #include <boost/hana/core/when.hpp> 0015 0016 0017 namespace boost { namespace hana { 0018 //! Apply a function on all the elements of a structure that compare 0019 //! equal to some value. 0020 //! @ingroup group-Functor 0021 //! 0022 //! 0023 //! Signature 0024 //! --------- 0025 //! Given `F` a Functor and `U` a type that can be compared with `T`'s, 0026 //! the signature is 0027 //! \f$ 0028 //! \mathtt{adjust} : F(T) \times U \times (T \to T) \to F(T) 0029 //! \f$ 0030 //! 0031 //! @param xs 0032 //! The structure to adjust with `f`. 0033 //! 0034 //! @param value 0035 //! An object that is compared with each element `x` of the structure. 0036 //! Elements of the structure that compare equal to `value` are adjusted 0037 //! with the `f` function. 0038 //! 0039 //! @param f 0040 //! A function called as `f(x)` on the element(s) of the structure that 0041 //! compare equal to `value`. 0042 //! 0043 //! 0044 //! Example 0045 //! ------- 0046 //! @include example/adjust.cpp 0047 #ifdef BOOST_HANA_DOXYGEN_INVOKED 0048 constexpr auto adjust = [](auto&& xs, auto&& value, auto&& f) { 0049 return tag-dispatched; 0050 }; 0051 #else 0052 template <typename Xs, typename = void> 0053 struct adjust_impl : adjust_impl<Xs, when<true>> { }; 0054 0055 struct adjust_t { 0056 template <typename Xs, typename Value, typename F> 0057 constexpr auto operator()(Xs&& xs, Value&& value, F&& f) const; 0058 }; 0059 0060 BOOST_HANA_INLINE_VARIABLE constexpr adjust_t adjust{}; 0061 #endif 0062 }} // end namespace boost::hana 0063 0064 #endif // !BOOST_HANA_FWD_ADJUST_HPP
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|