mpc
Haskell-like feature supports in C++
fst.hpp
Go to the documentation of this file.
1
2#pragma once
4
5namespace mpc {
7 namespace detail::_fst {
8 template <auto>
9 void get(auto&) = delete;
10 template <auto>
11 void get(const auto&) = delete;
12
13 template <std::size_t Idx>
14 struct get_op {
15 template <class T>
16 constexpr auto operator()(T&& t) const //
17 noexcept(noexcept(get<Idx>(std::forward<T>(t)))) //
18 -> decltype(get<Idx>(std::forward<T>(t))) {
19 return get<Idx>(std::forward<T>(t));
20 }
21 };
22 } // namespace detail::_fst
24
25 inline namespace cpo {
30
35 } // namespace cpo
36} // namespace mpc
constexpr partial< detail::_fst::get_op< 1 > > snd
Returns the second element of the given tuple-like object.
Definition: fst.hpp:34
constexpr partial< detail::_fst::get_op< 0 > > fst
Returns the first element of the given tuple-like object.
Definition: fst.hpp:29
constexpr decltype(auto) get(single< T, Tag > &s)
get for single
Definition: single.hpp:176
Implements a perfect-forwarding call wrapper.
Definition: partial.hpp:63