d
then()Size: a a a
d
then()AT
JA
d
d
AT
d
U
-Wl,--allow-multiple-definition__attribute__((weak))d
__attribute__((weak))$ g++ -std=c++20 -fcoroutines -o CoroTest.exe CoroTest.cpp coroutine.cpp
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccVys6BV.o:coroutine.cpp:(.text+0x0): multiple definition of `.weak._ZNSt7__n486122__dummy_resume_destroyEv._ZSt21is_constant_evaluatedv'; C:\msys64\tmp\cc1UwxKb.o:CoroTest.cpp:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccVys6BV.o:coroutine.cpp:(.data+0x0): multiple definition of `.weak._ZNSt7__n486114__noop_coro_frE._ZSt21is_constant_evaluatedv'; C:\msys64\tmp\cc1UwxKb.o:CoroTest.cpp:(.data+0x0): first defined here
collect2.exe: error: ld returned 1 exit statusd
__attribute__((weak))d
U
$ g++ -std=c++20 -fcoroutines -o CoroTest.exe CoroTest.cpp coroutine.cpp
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccVys6BV.o:coroutine.cpp:(.text+0x0): multiple definition of `.weak._ZNSt7__n486122__dummy_resume_destroyEv._ZSt21is_constant_evaluatedv'; C:\msys64\tmp\cc1UwxKb.o:CoroTest.cpp:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\msys64\tmp\ccVys6BV.o:coroutine.cpp:(.data+0x0): multiple definition of `.weak._ZNSt7__n486114__noop_coro_frE._ZSt21is_constant_evaluatedv'; C:\msys64\tmp\cc1UwxKb.o:CoroTest.cpp:(.data+0x0): first defined here
collect2.exe: error: ld returned 1 exit statusd
d
coroutine и type_traits причём нужно заюзать is_constant_evaluated и вещи связанные с корутинамиd
d
PK
dse::util::task<int> job(dse::core::ThreadPool& pool) {
std::cout << "a" << std::endl;
co_await pool;
std::cout << "b" << std::endl;
co_await pool;
pool.stop();
co_return 0;
}PK
d
PK
co_await это тип) парсер в голове старенький