3 Forward declares `boost::hana::fuse`.
5 @copyright Louis Dionne 2013-2016
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_FUSE_HPP
11 #define BOOST_HANA_FWD_FUSE_HPP
13 #include <boost/hana/config.hpp>
16 BOOST_HANA_NAMESPACE_BEGIN
17 //! Transform a function taking multiple arguments into a function that
18 //! can be called with a compile-time `Foldable`.
19 //! @ingroup group-Foldable
22 //! This function is provided for convenience as a different way of
23 //! calling `unpack`. Specifically, `fuse(f)` is a function such that
25 //! fuse(f)(foldable) == unpack(foldable, f)
28 //! where `x...` are the elements in the foldable. This function is
29 //! useful when one wants to create a function that accepts a foldable
30 //! which is not known yet.
33 //! This function is not tag-dispatched; customize `unpack` instead.
38 //! @include example/fuse.cpp
39 #ifdef BOOST_HANA_DOXYGEN_INVOKED
40 constexpr auto fuse = [](auto&& f) {
41 return [perfect-capture](auto&& xs) -> decltype(auto) {
42 return unpack(forwarded(xs), forwarded(f));
48 constexpr auto operator()(F&& f) const;
51 constexpr fuse_t fuse{};
53 BOOST_HANA_NAMESPACE_END
55 #endif // !BOOST_HANA_FWD_FUSE_HPP