RxCpp
The Reactive Extensions for Native (RxCpp) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
Ix
CPP
src
cpplinq
linq_skip.hpp
Go to the documentation of this file.
1
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
3
#if !defined(CPPLINQ_LINQ_SKIP_HPP)
4
#define CPPLINQ_LINQ_SKIP_HPP
5
#pragma once
6
7
#include <cstddef>
8
9
namespace
cpplinq
10
{
11
template
<
class
Collection>
12
struct
linq_skip
13
{
14
public
:
15
typedef
typename
Collection::cursor
cursor
;
16
17
linq_skip
(
const
Collection& c, std::size_t n) : c(c), n(n) {}
18
19
cursor
get_cursor
()
const
{
20
std::size_t rem = n;
21
22
auto
cur = c.get_cursor();
23
while
(rem-- && !cur.empty()) {
24
cur.inc();
25
}
26
cur.forget();
27
return
cur;
28
}
29
30
private
:
31
Collection c;
32
std::size_t n;
33
};
34
}
35
#endif // !defined(CPPLINQ_LINQ_SKIP_HPP)
36
37
cpplinq::linq_skip::get_cursor
cursor get_cursor() const
Definition:
linq_skip.hpp:19
cpplinq::linq_skip
Definition:
linq_skip.hpp:12
cpplinq
Definition:
linq.hpp:186
cpplinq::linq_skip::cursor
Collection::cursor cursor
Definition:
linq_skip.hpp:15
cpplinq::linq_skip::linq_skip
linq_skip(const Collection &c, std::size_t n)
Definition:
linq_skip.hpp:17
Generated on Tue Jan 28 2020 00:00:00 for RxCpp by
1.8.17