summaryrefslogtreecommitdiff
path: root/Ix
diff options
context:
space:
mode:
authorKirk Shoop <kirk.shoop@microsoft.com>2013-03-31 12:09:25 -0700
committerKirk Shoop <kirk.shoop@microsoft.com>2013-03-31 12:09:25 -0700
commit57ca6b685eb6cbb4e5233551be1b66da5e5a0846 (patch)
tree581ce9fa2ea7cc942c058cfb5c29c82713b63e5d /Ix
parent75908d25adab4f935209e272a3ee1287be325038 (diff)
downloadRxCpp-57ca6b685eb6cbb4e5233551be1b66da5e5a0846.tar.gz
adds from_iterable
from_iterable(r, opt - scheduler) adapts any r that satisfies std::begin(r) and std::end(r) into an Observable<decltype(*begin(r))>
Diffstat (limited to 'Ix')
-rw-r--r--Ix/CPP/src/cpplinq/util.hpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/Ix/CPP/src/cpplinq/util.hpp b/Ix/CPP/src/cpplinq/util.hpp
index 953a48a..ee3d7eb 100644
--- a/Ix/CPP/src/cpplinq/util.hpp
+++ b/Ix/CPP/src/cpplinq/util.hpp
@@ -192,15 +192,7 @@ namespace cpplinq { namespace util {
return is_set ? reinterpret_cast<const T*>(&storage) : 0;
}
- void set(const T& value) {
- if (is_set) {
- *reinterpret_cast<T*>(&storage) = value;
- } else {
- new (reinterpret_cast<T*>(&storage)) T(value);
- is_set = true;
- }
- }
- void set(T&& value) {
+ void set(T value) {
if (is_set) {
*reinterpret_cast<T*>(&storage) = std::move(value);
} else {