cli11
Loading...
Searching...
No Matches
cli::detail::pair_adaptor< T > Struct Template Referenceexport
module cli11

Uniform access to the halves of a container's element. More...

Inheritance diagram for cli::detail::pair_adaptor< T >:

Public Types

using value_type = typename T::value_type
 The container's element type.
using first_type = std::remove_const_t<value_type>
 The type of the first half.
using second_type = std::remove_const_t<value_type>
 The type of the second half.

Static Public Member Functions

template<typename Q>
static auto first (Q &&pair_value) -> decltype(std::forward< Q >(pair_value))
 Returns the first half of an element.
template<typename Q>
static auto second (Q &&pair_value) -> decltype(std::forward< Q >(pair_value))
 Returns the second half of an element.

Detailed Description

template<typename T>
struct cli::detail::pair_adaptor< T >

Uniform access to the halves of a container's element.

For a map-like container the halves are the key and the value. For any other container both halves are the element itself, so that code handling is_member sets does not need to branch on container shape.

Template Parameters
TThe container to adapt.

Member Function Documentation

◆ first()

template<typename T>
template<typename Q>
auto cli::detail::pair_adaptor< T >::first ( Q && pair_value) -> decltype(std::forward< Q >(pair_value))
inlinestatic

Returns the first half of an element.

Parameters
pair_valueThe element.
Returns
The element itself.

◆ second()

template<typename T>
template<typename Q>
auto cli::detail::pair_adaptor< T >::second ( Q && pair_value) -> decltype(std::forward< Q >(pair_value))
inlinestatic

Returns the second half of an element.

Parameters
pair_valueThe element.
Returns
The element itself.

The documentation for this struct was generated from the following file: