#include <asio/experimental/promise.hpp>
#include <asio/experimental/use_promise.hpp>
#include <asio/io_context.hpp>
#include <asio/steady_timer.hpp>
auto main() -> int {
auto ioc = asio::io_context();
auto timer = asio::steady_timer(ioc);
auto promise = timer.async_wait(asio::experimental::use_promise);
promise([&](asio::error_code) {});
ioc.run();
}
Compile output:
C:\distlibs\host\VS\BuildTools\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x64\cl.exe /nologo /TP -D_WIN32_WINNT=0x0601 -IC:\Users\mfischer\src\cpp\mcpp-asio\build.debug\_deps\asio-src\asio\include /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd -std:c++20 /showIncludes /Fotests\CMakeFiles\foo.dir\foo.cpp.obj /Fdtests\CMakeFiles\foo.dir\ /FS -c C:\Users\mfischer\src\cpp\mcpp-asio\tests\foo.cpp
C:\Users\mfischer\src\cpp\mcpp-asio\build.debug\_deps\asio-src\asio\include\asio/experimental/impl/promise.hpp(60): error C2027: use of undefined type 'std::tuple<_Types...>'
C:\distlibs\host\VS\BuildTools\VC\Tools\MSVC\14.32.31326\include\utility(493): note: see declaration of 'std::tuple<_Types...>'
C:\Users\mfischer\src\cpp\mcpp-asio\build.debug\_deps\asio-src\asio\include\asio/experimental/impl/promise.hpp(185): note: see reference to class template instantiation 'asio::experimental::detail::promise_impl<void(Ts...),Executor,Allocator>' being compiled
Errors cleaned up:
asio/experimental/impl/promise.hpp(60): error C2027: use of undefined type 'std::tuple<_Types...>'
utility(493): note: see declaration of 'std::tuple<_Types...>'
asio/experimental/impl/promise.hpp(185): note: see reference to class template instantiation 'asio::experimental::detail::promise_impl<void(Ts...),Executor,Allocator>' being compiled
Tested with:
Example code:
Compile output:
Errors cleaned up:
The tuple line references to this line in the MSVC STL: https://github.com/microsoft/STL/blob/b6b977885809f185189b4e3eb01a30967eba7a30/stl/inc/utility#L493
No idea how to fix it unfortunately... The include is right there in the very file that contains the error.