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

◆ identifier_of()

template<typename T>
auto kumi::identifier_of ( )
inlinenodiscardconstevalnoexcept

Extracts the identifiers from a kumi::concepts::field or returns the parameter.

Note
If the unqualified type of input does not model kumi::concepts::field, returns kumi::unkown.
Template Parameters
TThe type to extract the identifier from.
Returns
The identifier of the field or kumi::unknown.

Helper type

namespace kumi::result
{
template<typename Ts> struct identifier_of;
template<typename T> using identifier_of_t = typename identifier_of<T>::type;
}
consteval auto identifier_of() noexcept
Extracts the identifiers from a kumi::concepts::field or returns the parameter.
Definition field.hpp:157

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

Example:

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