KUMI v3.1.0
Exquisite Epidote
Loading...
Searching...
No Matches

◆ capture_field()

decltype(auto) constexpr capture_field ( T && t)
related

Creates a field from a given value keeping the qualifiers.

Template Parameters
NameThe label to associate to the field.
Parameters
tA forwarding reference to the input object.
Returns
A field that correctly keeps the qualified input type.

Helper type

namespace kumi::result
{
template<typename Ts> struct capture_field;
template<typename T> using capture_field_t = typename capture_field<T>::type;
}
decltype(auto) constexpr capture_field(T &&t) noexcept
Definition field.hpp:253

Computes the return type of a call to kumi::capture_field

Example:

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
int field = { 1 };
std::cout << field << "\n";
std::cout << kumi::capture_field<"x"_id>(field) << "\n";
}
Named wrapper over a type.
Definition field.hpp:26