Fix sync_wait() under latest MSVC compiler.
A compiler workaround was only being applied for compiler versions below a known version and would break whenever a new version comes out without a fix. It now just applies the workaround for all MSVC versions. I'll re-add the version limit once MSVC actually fixes the bug.
This commit is contained in:
parent
c76ba4ad56
commit
d7ef66dfb1
2 changed files with 3 additions and 2 deletions
|
@ -5,6 +5,7 @@
|
|||
#ifndef CPPCORO_DETAIL_SYNC_WAIT_TASK_HPP_INCLUDED
|
||||
#define CPPCORO_DETAIL_SYNC_WAIT_TASK_HPP_INCLUDED
|
||||
|
||||
#include <cppcoro/config.hpp>
|
||||
#include <cppcoro/awaitable_traits.hpp>
|
||||
#include <cppcoro/detail/lightweight_manual_reset_event.hpp>
|
||||
|
||||
|
@ -209,7 +210,7 @@ namespace cppcoro
|
|||
|
||||
};
|
||||
|
||||
#if CPPCORO_COMPILER_MSVC <= 191125506
|
||||
#if CPPCORO_COMPILER_MSVC
|
||||
// HACK: Work around bug in MSVC where passing a parameter by universal reference
|
||||
// results in an error when passed a move-only type, complaining that the copy-constructor
|
||||
// has been deleted. The parameter should be passed by reference and the compiler should
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace cppcoro
|
|||
auto sync_wait(AWAITABLE&& awaitable)
|
||||
-> typename cppcoro::awaitable_traits<AWAITABLE&&>::await_result_t
|
||||
{
|
||||
#if CPPCORO_COMPILER_MSVC <= 191125506
|
||||
#if CPPCORO_COMPILER_MSVC
|
||||
// HACK: Need to explicitly specify template argument to make_sync_wait_task
|
||||
// here to work around a bug in MSVC when passing parameters by universal
|
||||
// reference to
|
||||
|
|
Loading…
Reference in a new issue