mpc
Haskell-like feature supports in C++
constant.hpp
Go to the documentation of this file.
1
2#pragma once
4
5namespace mpc {
6 namespace detail {
7 struct constant_op {
8 template <class T, class U>
9 constexpr auto operator()(T&& t, U&&) const //
10 noexcept(noexcept(std::forward<T>(t))) //
11 -> decltype(std::forward<T>(t)) {
12 return std::forward<T>(t);
13 }
14 };
15 } // namespace detail
16
17 inline namespace cpo {
22 } // namespace cpo
23} // namespace mpc
constexpr partial< detail::constant_op > constant
Returns a unary function always returning the first input.
Definition: constant.hpp:21
Definition: constant.hpp:7
Implements a perfect-forwarding call wrapper.
Definition: partial.hpp:63