Permalink
Browse files

Final changes for fix

  • Loading branch information...
FelixPetriconi committed Aug 9, 2018
1 parent 7944b0b commit 5929d95ce30af4a8b1c403c4529aad36cec16049
Showing with 8 additions and 3 deletions.
  1. +3 −3 stlab/concurrency/task.hpp
  2. +5 −0 test/task_test.cpp
@@ -216,7 +216,7 @@ class task<R(Args...)> {
R operator()(Args... args) { return _vtable_ptr->invoke(&_model, std::forward<Args>(args)...); }
friend inline void swap(task& x, task& y) noexcept { return x.swap(y); }
friend inline void swap(task& x, task& y) { return x.swap(y); }
friend inline bool operator==(const task& x, std::nullptr_t) { return !static_cast<bool>(x); }
friend inline bool operator==(std::nullptr_t, const task& x) { return !static_cast<bool>(x); }
friend inline bool operator!=(const task& x, std::nullptr_t) { return static_cast<bool>(x); }
@@ -256,12 +256,12 @@ const typename task<R(Args...)>::concept task<R(Args...)>::model<F, true>::_vtab
template <class R, class... Args>
template <class F>
const typename task<R(Args...)>::concept task<R(Args...)>::template model<F, false>::_vtable = { dtor, move_ctor, invoke,
target_type_, pointer, const_pointer };
target_type, pointer, const_pointer };
template <class R, class... Args>
template <class F>
const typename task<R(Args...)>::concept task<R(Args...)>::template model<F, true>::_vtable = { dtor, move_ctor, invoke,
target_type_, pointer, const_pointer };
target_type, pointer, const_pointer };
#else
View
@@ -194,6 +194,11 @@ BOOST_AUTO_TEST_CASE(task_type_tests) {
BOOST_CHECK(!t);
}
{
task<int()> t(nullptr);
BOOST_CHECK(!t);
}
{
// large model
task<int()> t = large_model();

0 comments on commit 5929d95

Please sign in to comment.