Skip to content

Commit 3d6cd95

Browse files
committed
no MSVC 2017 workarounds on MSVC 2019
1 parent 25c811e commit 3d6cd95

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/cppcoro/detail/sync_wait_task.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace cppcoro
6868
return completion_notifier{};
6969
}
7070

71-
#if CPPCORO_COMPILER_MSVC
71+
#if CPPCORO_COMPILER_MSVC && CPPCORO_COMPILER_MSVC < 19'00'00000
7272
// HACK: This is needed to work around a bug in MSVC 2017.7/2017.8.
7373
// See comment in make_sync_wait_task below.
7474
template<typename Awaitable>
@@ -245,7 +245,7 @@ namespace cppcoro
245245

246246
};
247247

248-
#if CPPCORO_COMPILER_MSVC
248+
#if CPPCORO_COMPILER_MSVC && CPPCORO_COMPILER_MSVC < 19'00'00000
249249
// HACK: Work around bug in MSVC where passing a parameter by universal reference
250250
// results in an error when passed a move-only type, complaining that the copy-constructor
251251
// has been deleted. The parameter should be passed by reference and the compiler should

include/cppcoro/detail/when_all_task.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace cppcoro
7676
assert(false);
7777
}
7878

79-
#if CPPCORO_COMPILER_MSVC
79+
#if CPPCORO_COMPILER_MSVC && CPPCORO_COMPILER_MSVC < 19'00'00000
8080
// HACK: This is needed to work around a bug in MSVC 2017.7/2017.8.
8181
// See comment in make_when_all_task below.
8282
template<typename Awaitable>
@@ -301,7 +301,7 @@ namespace cppcoro
301301
std::enable_if_t<!std::is_void_v<RESULT>, int> = 0>
302302
when_all_task<RESULT> make_when_all_task(AWAITABLE awaitable)
303303
{
304-
#if CPPCORO_COMPILER_MSVC
304+
#if CPPCORO_COMPILER_MSVC && CPPCORO_COMPILER_MSVC < 19'00'00000
305305
// HACK: Workaround another bug in MSVC where the expression 'co_yield co_await x' seems
306306
// to completely ignore the co_yield an never calls promise.yield_value().
307307
// The coroutine seems to be resuming the 'co_await' after the 'co_yield'
@@ -329,7 +329,7 @@ namespace cppcoro
329329
std::enable_if_t<!std::is_void_v<RESULT>, int> = 0>
330330
when_all_task<RESULT> make_when_all_task(std::reference_wrapper<AWAITABLE> awaitable)
331331
{
332-
#if CPPCORO_COMPILER_MSVC
332+
#if CPPCORO_COMPILER_MSVC && CPPCORO_COMPILER_MSVC < 19'00'00000
333333
// HACK: Workaround another bug in MSVC where the expression 'co_yield co_await x' seems
334334
// to completely ignore the co_yield and never calls promise.yield_value().
335335
// The coroutine seems to be resuming the 'co_await' after the 'co_yield'

include/cppcoro/sync_wait.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace cppcoro
1818
auto sync_wait(AWAITABLE&& awaitable)
1919
-> typename cppcoro::awaitable_traits<AWAITABLE&&>::await_result_t
2020
{
21-
#if CPPCORO_COMPILER_MSVC
21+
#if CPPCORO_COMPILER_MSVC && CPPCORO_COMPILER_MSVC < 19'00'00000
2222
// HACK: Need to explicitly specify template argument to make_sync_wait_task
2323
// here to work around a bug in MSVC when passing parameters by universal
2424
// reference to a coroutine which causes the compiler to think it needs to

0 commit comments

Comments
 (0)