Skip to content

Add awaitable to forward declarations - #1764

Open
SmartAI wants to merge 1 commit into
chriskohlhoff:masterfrom
SmartAI:add-awaitable-forward-declaration
Open

Add awaitable to forward declarations#1764
SmartAI wants to merge 1 commit into
chriskohlhoff:masterfrom
SmartAI:add-awaitable-forward-declaration

Conversation

@SmartAI

@SmartAI SmartAI commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Add awaitable to asio/fwd.hpp when coroutine support is available.
  • Share one guarded declaration with awaitable.hpp, keeping the default executor argument in a single declaration.
  • Extend the forward-header test to declare awaitable<void> before the full header is included.

Motivation

asio/fwd.hpp cannot currently declare an API that returns asio::awaitable<T> without including the complete coroutine implementation.
This fills that gap while preserving the existing default executor and versioned namespace behavior.

Testing

  • GCC 16.2: official Autotools targets for fwd_first and fwd_last.
  • GCC 15.2 and Clang 21.1: fwd_first and fwd_last with versioned namespace, TS executor default, their combination, and ASIO_DISABLE_CO_AWAIT.
  • C++11 compile checks for the non-coroutine path.
  • perl ./boostify.pl --includes-only and generated Boost.Asio forward-header probes with GCC and Clang.

@SmartAI
SmartAI force-pushed the add-awaitable-forward-declaration branch 3 times, most recently from 942cb0b to b31dd75 Compare August 24, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant