summaryrefslogtreecommitdiff
path: root/Ix/CPP
diff options
context:
space:
mode:
authorMatt <MattPD@users.noreply.github.com>2015-07-23 15:47:33 +0200
committerMatt <MattPD@users.noreply.github.com>2015-07-23 15:47:33 +0200
commitc32780ce46b2b2234bcf1b7cc36a25be8272a25c (patch)
treebbe639f4b3b5d6fb66eae4e75103eb8a8d4835dd /Ix/CPP
parente17e97304e93070f675ab4cd3affdb158a4e1bb4 (diff)
downloadRxCpp-c32780ce46b2b2234bcf1b7cc36a25be8272a25c.tar.gz
Update linq_take.hpp
Diffstat (limited to 'Ix/CPP')
-rw-r--r--Ix/CPP/src/cpplinq/linq_take.hpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/Ix/CPP/src/cpplinq/linq_take.hpp b/Ix/CPP/src/cpplinq/linq_take.hpp
index 7e16d6e..a7093ef 100644
--- a/Ix/CPP/src/cpplinq/linq_take.hpp
+++ b/Ix/CPP/src/cpplinq/linq_take.hpp
@@ -4,6 +4,8 @@
#define CPPLINQ_LINQ_TAKE_HPP
#pragma once
+#include <cstddef>
+
namespace cpplinq
{
template <class InnerCursor>
@@ -13,7 +15,7 @@ namespace cpplinq
typedef typename InnerCursor::reference_type reference_type;
typedef typename InnerCursor::cursor_category cursor_category;
- linq_take_cursor(const InnerCursor& cur, size_t rem) : cur(cur), rem(rem) {}
+ linq_take_cursor(const InnerCursor& cur, std::size_t rem) : cur(cur), rem(rem) {}
void forget() { cur.forget(); }
bool empty() const { return cur.empty() || rem == 0; }
@@ -23,13 +25,13 @@ namespace cpplinq
bool atbegin() const { return cur.atbegin(); }
void dec() { cur.dec(); --rem; }
- void skip(size_t n) { cur.skip(n); rem -= n; }
- size_t position() const { return cur.position(); }
- size_t size() const { return cur.size(); }
+ void skip(std::size_t n) { cur.skip(n); rem -= n; }
+ std::size_t position() const { return cur.position(); }
+ std::size_t size() const { return cur.size(); }
private:
InnerCursor cur;
- size_t rem;
+ std::size_t rem;
};
namespace detail {
@@ -37,7 +39,7 @@ namespace cpplinq
linq_take_cursor<typename Collection::cursor>
take_get_cursor_(
const Collection& c,
- size_t n,
+ std::size_t n,
onepass_cursor_tag
)
{
@@ -48,7 +50,7 @@ namespace cpplinq
typename Collection::cursor
take_get_cursor_(
const Collection& c,
- size_t n,
+ std::size_t n,
random_access_cursor_tag
)
{
@@ -71,14 +73,14 @@ namespace cpplinq
linq_take_cursor<typename Collection::cursor>>::type
cursor;
- linq_take(const Collection& c, size_t n) : c(c), n(n) {}
+ linq_take(const Collection& c, std::size_t n) : c(c), n(n) {}
cursor get_cursor() const {
return detail::take_get_cursor_(c, n, typename Collection::cursor::cursor_category());
}
Collection c;
- size_t n;
+ std::size_t n;
};
template <class Collection>