Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
console::Params< T > Class Template Reference

单参数版本的 Params 特化,递归基类。 More...

#include <params.h>

Public Member Functions

 Params (const T &value)
 从给定值构造单参数 Params。
template<class F>
auto apply (F f) const -> decltype(f(value))
 将存储的参数应用于可调用对象。

Private Attributes

T value
 存储的参数值

Detailed Description

template<class T>
class console::Params< T >

单参数版本的 Params 特化,递归基类。

Template Parameters
T参数的类型。

作为递归链的终止节点,存储单个值并提供 apply 方法。

Constructor & Destructor Documentation

◆ Params()

template<class T>
console::Params< T >::Params ( const T & value)
inline

从给定值构造单参数 Params。

Parameters
value要存储的参数值(按常量引用传入)。

Member Function Documentation

◆ apply()

template<class T>
template<class F>
auto console::Params< T >::apply ( F f) const -> decltype(f(value))
inline

将存储的参数应用于可调用对象。

Template Parameters
F可调用对象的类型,必须能接受类型 T 的参数。
Parameters
f要调用的可调用对象。
Returns
decltype(f(value)) f 的返回值。
Note
对于单参数版本,直接使用存储的值调用 f。

Member Data Documentation

◆ value

template<class T>
T console::Params< T >::value
private

存储的参数值


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