Permalink
Browse files

Partially revert "Remove vtable empty flag"

This reverts commit eb83d9d.
  • Loading branch information...
K-ballo committed Dec 4, 2018
1 parent 6feb43f commit e926c27383fb835658965fec164af09624885f2f
Showing with 4 additions and 1 deletion.
  1. +1 −1 hpx/util/detail/basic_function.hpp
  2. +3 −0 hpx/util/detail/vtable/unique_function_vtable.hpp
@@ -136,7 +136,7 @@ namespace hpx { namespace util { namespace detail

bool empty() const noexcept
{
return vptr == detail::get_empty_function_vtable<VTable>();
return vptr->empty;
}

explicit operator bool() const noexcept
@@ -24,10 +24,13 @@ namespace hpx { namespace util { namespace detail
struct unique_function_vtable
: vtable, callable_vtable<Sig>
{
bool empty;

template <typename T>
HPX_CONSTEXPR unique_function_vtable(construct_vtable<T>) noexcept
: vtable(construct_vtable<T>())
, callable_vtable<Sig>(construct_vtable<T>())
, empty(std::is_same<T, empty_function>::value)
{}
};
}}}

0 comments on commit e926c27

Please sign in to comment.