Commit 304cdf2d authored by Dominik Charousset's avatar Dominik Charousset

Fix builds errors on MSVC and GCC

parent a78f55e3
...@@ -27,10 +27,6 @@ public: ...@@ -27,10 +27,6 @@ public:
using const_reverse_iterator = typename std_type::const_reverse_iterator; using const_reverse_iterator = typename std_type::const_reverse_iterator;
// -- constants --------------------------------------------------------------
static inline const size_type npos = std_type::npos;
// -- constructors, destructors, and assignment operators -------------------- // -- constructors, destructors, and assignment operators --------------------
cow_vector() { cow_vector() {
......
...@@ -487,8 +487,11 @@ transformation<Step> observable<T>::transform(Step step) { ...@@ -487,8 +487,11 @@ transformation<Step> observable<T>::transform(Step step) {
} }
template <class T> template <class T>
transformation<step::distinct<T>> observable<T>::distinct() { template <class U>
return transform(step::distinct<T>{}); transformation<step::distinct<U>> observable<T>::distinct() {
static_assert(detail::is_complete<std::hash<U>>,
"distinct uses a hash set and thus requires std::hash<T>");
return transform(step::distinct<U>{});
} }
template <class T> template <class T>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "caf/cow_vector.hpp" #include "caf/cow_vector.hpp"
#include "caf/defaults.hpp" #include "caf/defaults.hpp"
#include "caf/detail/is_complete.hpp"
#include "caf/disposable.hpp" #include "caf/disposable.hpp"
#include "caf/flow/fwd.hpp" #include "caf/flow/fwd.hpp"
#include "caf/flow/op/base.hpp" #include "caf/flow/op/base.hpp"
...@@ -68,7 +69,8 @@ public: ...@@ -68,7 +69,8 @@ public:
/// Makes all values unique by suppressing items that have been emitted in the /// Makes all values unique by suppressing items that have been emitted in the
/// past. /// past.
transformation<step::distinct<T>> distinct(); template <class U = T>
transformation<step::distinct<U>> distinct();
/// Registers a callback for `on_complete` and `on_error` events. /// Registers a callback for `on_complete` and `on_error` events.
template <class F> template <class F>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment