summaryrefslogtreecommitdiff
path: root/boost/coroutine2/detail/push_coroutine.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/coroutine2/detail/push_coroutine.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/coroutine2/detail/push_coroutine.hpp')
-rw-r--r--boost/coroutine2/detail/push_coroutine.hpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/boost/coroutine2/detail/push_coroutine.hpp b/boost/coroutine2/detail/push_coroutine.hpp
index d152be2cde..4b5ba5c25d 100644
--- a/boost/coroutine2/detail/push_coroutine.hpp
+++ b/boost/coroutine2/detail/push_coroutine.hpp
@@ -54,8 +54,7 @@ public:
push_coroutine & operator=( push_coroutine && other) noexcept {
if ( this == & other) return * this;
- cb_ = other.cb_;
- other.cb_ = nullptr;
+ std::swap( cb_, other.cb_);
return * this;
}
@@ -67,11 +66,17 @@ public:
bool operator!() const noexcept;
- class iterator : public std::iterator< std::output_iterator_tag, void, void, void, void > {
+ class iterator {
private:
push_coroutine< T > * c_{ nullptr };
public:
+ typedef std::output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
iterator() noexcept = default;
explicit iterator( push_coroutine< T > * c) noexcept :
@@ -134,8 +139,7 @@ public:
push_coroutine & operator=( push_coroutine && other) noexcept {
if ( this == & other) return * this;
- cb_ = other.cb_;
- other.cb_ = nullptr;
+ std::swap( cb_, other.cb_);
return * this;
}
@@ -145,11 +149,17 @@ public:
bool operator!() const noexcept;
- class iterator : public std::iterator< std::output_iterator_tag, void, void, void, void > {
+ class iterator {
private:
push_coroutine< T & > * c_{ nullptr };
public:
+ typedef std::output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
iterator() noexcept = default;
explicit iterator( push_coroutine< T & > * c) noexcept :
@@ -212,8 +222,7 @@ public:
push_coroutine & operator=( push_coroutine && other) noexcept {
if ( this == & other) return * this;
- cb_ = other.cb_;
- other.cb_ = nullptr;
+ std::swap( cb_, other.cb_);
return * this;
}