lhmouse / mcfgthread

Cornerstone of the MOST efficient std::thread on Windows for mingw-w64
https://gcc-mcf.lhmouse.com/
Other
269 stars 28 forks source link

Some improvements for conditional compilation #77

Closed frederick-vs-ja closed 1 year ago

frederick-vs-ja commented 1 year ago

Explanation for using enable_if in __do_invoke:

lhmouse commented 1 year ago

That file needs to be completely rewritten in a 'satisfying' way. For example, ideally these __wait_* functions and _INVOKE belong in another file..

lhmouse commented 1 year ago

A more conforming solution would be:

template<class _Member, class _Class, class... _Args>
__MCF_CXX14(constexpr)
void  // for simplicity
__invoke(_Member _Class::* __memp, _Args&&... __args)
  {
    ::std::mem_fn(__memp) (::std::forward<_Args>(__args)...);
  }

template<class _Callable, class... _Args>
__MCF_CXX14(constexpr)
void  // for simplicity
__invoke(_Callable&& __callable, _Args&&... __args)
  {
    ::std::forward<_Callable>(__callable) (::std::forward<_Args>(__args)...);
  }
lhmouse commented 1 year ago

This has been obsoleted.