3 Forward declares `boost::hana::transform`.
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_TRANSFORM_HPP
11 #define BOOST_HANA_FWD_TRANSFORM_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 namespace boost { namespace hana {
18 //! Map a function over a `Functor`.
19 //! @ingroup group-Functor
24 //! Given `F` a Functor, the signature is
26 //! \mathtt{transform} : F(T) \times (T \to U) \to F(U)
30 //! The structure to map `f` over.
33 //! A function called as `f(x)` on element(s) `x` of the structure,
34 //! and returning a new value to replace `x` in the structure.
39 //! @include example/transform.cpp
40 #ifdef BOOST_HANA_DOXYGEN_INVOKED
41 constexpr auto transform = [](auto&& xs, auto&& f) {
42 return tag-dispatched;
45 template <typename Xs, typename = void>
46 struct transform_impl : transform_impl<Xs, when<true>> { };
49 template <typename Xs, typename F>
50 constexpr auto operator()(Xs&& xs, F&& f) const;
53 BOOST_HANA_INLINE_VARIABLE constexpr transform_t transform{};
55 }} // end namespace boost::hana
57 #endif // !BOOST_HANA_FWD_TRANSFORM_HPP