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

跳过前n个元素的生成器适配器。 More...

#include <gen.h>

Inheritance diagram for console::gen::Drop< Gen >:
console::Generator< Drop< Gen >, Gen::iterator::value_type >

Public Member Functions

 Drop (Gen g, size_t n)
 构造函数。
bool done ()
 检查生成器是否已完成。
auto current () -> decltype(gen.current())
 获取当前值。
void advance ()
 向前移动一步。
Public Member Functions inherited from console::Generator< Drop< Gen >, Gen::iterator::value_type >
iterator iter () const
 获取生成器的迭代器对象。
iterator begin () const
 获取开始迭代器。
iterator end () const
 获取结束迭代器。
bool done ()
 检查生成器是否已完成。
Gen::iterator::value_type current ()
 获取当前值。
void advance ()
 推进生成器到下一个位置。

Private Member Functions

void do_drop ()
 执行跳过操作。

Private Attributes

Gen gen
size_t count
bool droped = false

Additional Inherited Members

Public Types inherited from console::Generator< Drop< Gen >, Gen::iterator::value_type >
typedef Gen::iterator::value_type value_type
 生成器产生的值类型。

Detailed Description

template<class Gen>
class console::gen::Drop< Gen >

跳过前n个元素的生成器适配器。

Template Parameters
Gen源生成器类型。

Constructor & Destructor Documentation

◆ Drop()

template<class Gen>
console::gen::Drop< Gen >::Drop ( Gen g,
size_t n )
inline

构造函数。

Parameters
g源生成器。
n要跳过的元素个数。

Member Function Documentation

◆ advance()

template<class Gen>
void console::gen::Drop< Gen >::advance ( )
inline

向前移动一步。

◆ current()

template<class Gen>
auto console::gen::Drop< Gen >::current ( ) -> decltype(gen.current())
inline

获取当前值。

Returns
当前值。

◆ do_drop()

template<class Gen>
void console::gen::Drop< Gen >::do_drop ( )
inlineprivate

执行跳过操作。

◆ done()

template<class Gen>
bool console::gen::Drop< Gen >::done ( )
inline

检查生成器是否已完成。

Returns
如果源生成器已完成则返回true。

Member Data Documentation

◆ count

template<class Gen>
size_t console::gen::Drop< Gen >::count
private

◆ droped

template<class Gen>
bool console::gen::Drop< Gen >::droped = false
private

◆ gen

template<class Gen>
Gen console::gen::Drop< Gen >::gen
private

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