Skip to content

Commit

Permalink
Final changes for fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixPetriconi committed Aug 9, 2018
1 parent 7944b0b commit 5929d95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stlab/concurrency/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions test/task_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5929d95

Please sign in to comment.