| 1 | /*============================================================================= |
| 2 | Copyright (c) 2015 Paul Fultz II |
| 3 | make.h |
| 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | ==============================================================================*/ |
| 7 | |
| 8 | #ifndef BOOST_HOF_GUARD_MAKE_H |
| 9 | #define BOOST_HOF_GUARD_MAKE_H |
| 10 | |
| 11 | #include <boost/hof/detail/move.hpp> |
| 12 | #include <boost/hof/detail/join.hpp> |
| 13 | #include <boost/hof/detail/delegate.hpp> |
| 14 | |
| 15 | namespace boost { namespace hof { namespace detail { |
| 16 | |
| 17 | template<template<class...> class Adaptor> |
| 18 | struct make |
| 19 | { |
| 20 | constexpr make() noexcept |
| 21 | {} |
| 22 | template<class... Fs, class Result=BOOST_HOF_JOIN(Adaptor, Fs...)> |
| 23 | constexpr Result operator()(Fs... fs) const BOOST_HOF_NOEXCEPT_CONSTRUCTIBLE(Result, Fs&&...) |
| 24 | { |
| 25 | return Result(static_cast<Fs&&>(fs)...); |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | }}} // namespace boost::hof |
| 30 | |
| 31 | #endif |
| 32 | |