mpc
Haskell-like feature supports in C++
constant.hpp
Go to the documentation of this file.
1
2
#pragma once
3
#include <
mpc/functional/partial.hpp
>
4
5
namespace
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 {
21
inline
constexpr
partial<detail::constant_op>
constant
;
22
}
// namespace cpo
23
}
// namespace mpc
mpc::cpo::constant
constexpr partial< detail::constant_op > constant
Returns a unary function always returning the first input.
Definition:
constant.hpp:21
partial.hpp
mpc::detail::constant_op
Definition:
constant.hpp:7
mpc::partial
Implements a perfect-forwarding call wrapper.
Definition:
partial.hpp:63
include
mpc
prelude
constant.hpp
Generated by
1.9.2