Insane_DNS/libraries/asio-1.28.1/doc/asio/using.html

2425 lines
82 KiB
HTML
Raw Permalink Normal View History

2023-10-24 21:59:30 -04:00
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using, Building, and Configuring Asio</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../index.html" title="Asio">
<link rel="up" href="../index.html" title="Asio">
<link rel="prev" href="overview/implementation.html" title="Platform-Specific Implementation Notes">
<link rel="next" href="tutorial.html" title="Tutorial">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../asio.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overview/implementation.html"><img src="../prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="asio.using"></a><a class="link" href="using.html" title="Using, Building, and Configuring Asio">Using, Building, and Configuring Asio</a>
</h2></div></div></div>
<h4>
<a name="asio.using.h0"></a>
<span><a name="asio.using.supported_platforms"></a></span><a class="link" href="using.html#asio.using.supported_platforms">Supported
Platforms</a>
</h4>
<p>
The following platform and compiler combinations are regularly tested:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
Linux using g++ 4.6 or later
</li>
<li class="listitem">
Linux using clang 3.4 or later
</li>
<li class="listitem">
FreeBSD using g++ 9 or later
</li>
<li class="listitem">
macOS using Xcode 10 or later
</li>
<li class="listitem">
Win32 using Visual C++ 11.0 (Visual Studio 2012) or later
</li>
<li class="listitem">
Win64 using Visual C++ 11.0 (Visual Studio 2012) or later
</li>
</ul></div>
<p>
The following platforms may also work:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
AIX
</li>
<li class="listitem">
Android
</li>
<li class="listitem">
HP-UX
</li>
<li class="listitem">
iOS
</li>
<li class="listitem">
NetBSD
</li>
<li class="listitem">
OpenBSD
</li>
<li class="listitem">
QNX Neutrino
</li>
<li class="listitem">
Solaris
</li>
<li class="listitem">
Tru64
</li>
<li class="listitem">
Win32 using MinGW.
</li>
<li class="listitem">
Win32 using Cygwin. (<code class="computeroutput"><span class="identifier">__USE_W32_SOCKETS</span></code>
must be defined.)
</li>
</ul></div>
<h4>
<a name="asio.using.h1"></a>
<span><a name="asio.using.dependencies"></a></span><a class="link" href="using.html#asio.using.dependencies">Dependencies</a>
</h4>
<p>
The following libraries must be available in order to link programs that use
Asio:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
Boost.Coroutine (optional) if you use <a class="link" href="reference/spawn.html" title="spawn"><code class="computeroutput"><span class="identifier">spawn</span><span class="special">()</span></code></a>
to launch coroutines.
</li>
<li class="listitem">
Boost.Regex (optional) if you use any of the <a class="link" href="reference/read_until.html" title="read_until"><code class="computeroutput"><span class="identifier">read_until</span><span class="special">()</span></code></a>
or <a class="link" href="reference/async_read_until.html" title="async_read_until"><code class="computeroutput"><span class="identifier">async_read_until</span><span class="special">()</span></code></a> overloads that take a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span></code> parameter.
</li>
<li class="listitem">
<a href="http://www.openssl.org" target="_top">OpenSSL</a> (optional) if you use
Asio's SSL support.
</li>
</ul></div>
<p>
Furthermore, some of the examples also require Boost.Date_Time or Boost.Serialization
libraries.
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
With MSVC or Borland C++ you may want to add <code class="computeroutput"><span class="special">-</span><span class="identifier">DBOOST_DATE_TIME_NO_LIB</span></code> and <code class="computeroutput"><span class="special">-</span><span class="identifier">DBOOST_REGEX_NO_LIB</span></code>
to your project settings to disable autolinking of the Boost.Date_Time and
Boost.Regex libraries respectively. Alternatively, you may choose to build
these libraries and link to them.
</p></td></tr>
</table></div>
<h4>
<a name="asio.using.h2"></a>
<span><a name="asio.using.optional_separate_compilation"></a></span><a class="link" href="using.html#asio.using.optional_separate_compilation">Optional
separate compilation</a>
</h4>
<p>
By default, Asio is a header-only library. However, some developers may prefer
to build Asio using separately compiled source code. To do this, add <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">asio</span><span class="special">/</span><span class="identifier">impl</span><span class="special">/</span><span class="identifier">src</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> to
one (and only one) source file in a program, then build the program with <code class="computeroutput"><span class="identifier">ASIO_SEPARATE_COMPILATION</span></code> defined in the
project/compiler settings. Alternatively, <code class="computeroutput"><span class="identifier">ASIO_DYN_LINK</span></code>
may be defined to build a separately-compiled Asio as part of a shared library.
</p>
<p>
If using Asio's SSL support, you will also need to add <code class="computeroutput"><span class="preprocessor">#include</span>
<span class="special">&lt;</span><span class="identifier">asio</span><span class="special">/</span><span class="identifier">ssl</span><span class="special">/</span><span class="identifier">impl</span><span class="special">/</span><span class="identifier">src</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>.
</p>
<h4>
<a name="asio.using.h3"></a>
<span><a name="asio.using.debugger_support"></a></span><a class="link" href="using.html#asio.using.debugger_support">Debugger
support</a>
</h4>
<p>
Some debugger extensions for use with Asio may be found at <a href="https://github.com/chriskohlhoff/asio-debugger-extensions" target="_top">https://github.com/chriskohlhoff/asio-debugger-extensions</a>.
</p>
<h4>
<a name="asio.using.h4"></a>
<span><a name="asio.using.building_the_tests_and_examples_on_linux_or_unix"></a></span><a class="link" href="using.html#asio.using.building_the_tests_and_examples_on_linux_or_unix">Building
the tests and examples on Linux or UNIX</a>
</h4>
<p>
If the boost directory (e.g. the directory called <code class="computeroutput"><span class="identifier">boost_1_34_1</span></code>)
is in the same directory as the asio source kit, then you may configure asio
by simply going:
</p>
<pre class="programlisting"><span class="special">./</span><span class="identifier">configure</span>
</pre>
<p>
in the root directory of the asio source kit. Note that configure will always
use the most recent boost version it knows about (i.e. 1.34.1) in preference
to earlier versions, if there is more than one version present.
</p>
<p>
If the boost directory is in some other location, then you need to specify
this directory when running configure:
</p>
<pre class="programlisting"><span class="special">./</span><span class="identifier">configure</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">boost</span><span class="special">=</span><span class="emphasis"><em>path_to_boost</em></span>
</pre>
<p>
When specifying the boost directory in this way you should ensure that you
use an absolute path.
</p>
<p>
To build the examples, simply run <code class="computeroutput"><span class="identifier">make</span></code>
in the root directory of the asio source kit. To also build and run the unit
tests, to confirm that asio is working correctly, run <code class="computeroutput"><span class="identifier">make</span>
<span class="identifier">check</span></code>.
</p>
<h4>
<a name="asio.using.h5"></a>
<span><a name="asio.using.building_the_tests_and_examples_with_msvc"></a></span><a class="link" href="using.html#asio.using.building_the_tests_and_examples_with_msvc">Building
the tests and examples with MSVC</a>
</h4>
<p>
To build using the MSVC 9.0 (or later) command line compiler, perform the following
steps in a Command Prompt window:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
If you are using a version of boost other than 1.34.1, or if the boost
directory (i.e. the directory called <code class="computeroutput"><span class="identifier">boost_1_34_1</span></code>)
is not in the same directory as the asio source kit, then specify the location
of boost by running a command similar to <code class="literal">set BOOSTDIR=<span class="emphasis"><em>path_to_boost</em></span></code>.
Ensure that you specify an absolute path.
</li>
<li class="listitem">
Change to the asio <code class="computeroutput"><span class="identifier">src</span></code>
directory.
</li>
<li class="listitem">
Execute the command <code class="computeroutput"><span class="identifier">nmake</span> <span class="special">-</span><span class="identifier">f</span> <span class="identifier">Makefile</span><span class="special">.</span><span class="identifier">msc</span></code>.
</li>
<li class="listitem">
Execute the command <code class="computeroutput"><span class="identifier">nmake</span> <span class="special">-</span><span class="identifier">f</span> <span class="identifier">Makefile</span><span class="special">.</span><span class="identifier">msc</span> <span class="identifier">check</span></code> to run a suite of tests to confirm
that asio is working correctly.
</li>
</ul></div>
<h4>
<a name="asio.using.h6"></a>
<span><a name="asio.using.building_the_tests_and_examples_with_mingw"></a></span><a class="link" href="using.html#asio.using.building_the_tests_and_examples_with_mingw">Building
the tests and examples with MinGW</a>
</h4>
<p>
To build using the MinGW g++ compiler from the command line, perform the following
steps in a Command Prompt window:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
If you are using a version of boost other than 1.34.1, or if the boost
directory (i.e. the directory called <code class="computeroutput"><span class="identifier">boost_1_34_1</span></code>)
is not in the same directory as the asio source kit, then specify the location
of boost by running a command similar to <code class="literal">set BOOSTDIR=<span class="emphasis"><em>path_to_boost</em></span></code>.
Ensure that you specify an absolute path using <span class="emphasis"><em>forward slashes</em></span>
(i.e. <code class="computeroutput"><span class="identifier">c</span><span class="special">:/</span><span class="identifier">projects</span><span class="special">/</span><span class="identifier">boost_1_34_1</span></code> rather than <code class="computeroutput"><span class="identifier">c</span><span class="special">:\</span><span class="identifier">projects</span><span class="special">\</span><span class="identifier">boost_1_34_1</span></code>).
</li>
<li class="listitem">
Change to the asio <code class="computeroutput"><span class="identifier">src</span></code>
directory.
</li>
<li class="listitem">
Execute the command <code class="computeroutput"><span class="identifier">make</span> <span class="special">-</span><span class="identifier">f</span> <span class="identifier">Makefile</span><span class="special">.</span><span class="identifier">mgw</span></code>.
</li>
<li class="listitem">
Execute the command <code class="computeroutput"><span class="identifier">make</span> <span class="special">-</span><span class="identifier">f</span> <span class="identifier">Makefile</span><span class="special">.</span><span class="identifier">mgw</span> <span class="identifier">check</span></code> to run a suite of tests to confirm
that asio is working correctly.
</li>
</ul></div>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
The above instructions do not work when building inside MSYS. If you want
to build using MSYS, you should use <code class="literal">export</code> rather than
<code class="literal">set</code> to specify the location of boost.
</p></td></tr>
</table></div>
<h4>
<a name="asio.using.h7"></a>
<span><a name="asio.using.macros"></a></span><a class="link" href="using.html#asio.using.macros">Macros</a>
</h4>
<p>
The macros listed in the table below may be used to control the interface,
functionality, and behaviour of Asio.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Macro
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_DEPRECATED</span></code>
</p>
</td>
<td>
<p>
Disables Asio's deprecated interfaces and functionality.
</p>
<p>
See <a class="link" href="net_ts.html" title="Networking TS compatibility">Networking TS Compatibility</a>
for a list of older interfaces that have been deprecated, and their
replacements.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_TS_EXECUTORS</span></code>
</p>
</td>
<td>
<p>
Disables Asio's support for the Networking TS executor model.
</p>
<p>
By default, Asio simultaneously supports both Networking TS-style
executors, and executors that adhere to the proposed standard executor
model. This macro may be used to limit support to the proposed standard
executors only. See <a class="link" href="std_executors.html" title="Proposed Standard Executors">Proposed Standard
Executors</a> for more information.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_USE_TS_EXECUTOR_AS_DEFAULT</span></code>
</p>
</td>
<td>
<p>
Specifies that <a class="link" href="reference/any_io_executor.html" title="any_io_executor"><code class="computeroutput"><span class="identifier">any_io_executor</span></code></a> refer to
the Networking TS-style polymorphic wrapper.
</p>
<p>
The <code class="computeroutput"><span class="identifier">any_io_executor</span></code>
type alias is the default runtime-polymorphic executor for all I/O
objects. This type alias points to the <a class="link" href="reference/execution__any_executor.html" title="execution::any_executor"><code class="computeroutput"><span class="identifier">execution</span><span class="special">::</span><span class="identifier">any_executor</span><span class="special">&lt;&gt;</span></code></a>
template with a set of supportable properties specified for use with
I/O.
</p>
<p>
This new name may break existing code that directly uses the old
Networking TS-style polymorphic wrapper, <a class="link" href="reference/executor.html" title="executor"><code class="computeroutput"><span class="identifier">executor</span></code></a>. If required for
backward compatibility, <code class="computeroutput"><span class="identifier">ASIO_USE_TS_EXECUTOR_AS_DEFAULT</span></code>
changes the <code class="computeroutput"><span class="identifier">any_io_executor</span></code>
type alias to instead point to the <code class="computeroutput"><span class="identifier">executor</span></code>
polymorphic wrapper.
</p>
<p>
See <a class="link" href="std_executors.html" title="Proposed Standard Executors">Proposed Standard Executors</a>
for more information.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_DYNAMIC_BUFFER_V1</span></code>
</p>
</td>
<td>
<p>
Disables support for the <a class="link" href="reference/DynamicBuffer_v1.html" title="Dynamic buffer requirements (version 1)"><code class="computeroutput"><span class="identifier">DynamicBuffer_v1</span></code></a> type requirements.
</p>
<p>
By default, dynamic buffer operations such as <a class="link" href="reference/read.html" title="read"><code class="computeroutput"><span class="identifier">read</span></code></a>, <a class="link" href="reference/async_read.html" title="async_read"><code class="computeroutput"><span class="identifier">async_read</span></code></a>, <a class="link" href="reference/read_until.html" title="read_until"><code class="computeroutput"><span class="identifier">read_until</span></code></a>, <a class="link" href="reference/async_read_until.html" title="async_read_until"><code class="computeroutput"><span class="identifier">async_read_until</span></code></a>, <a class="link" href="reference/write.html" title="write"><code class="computeroutput"><span class="identifier">write</span></code></a>,
and <a class="link" href="reference/async_write.html" title="async_write"><code class="computeroutput"><span class="identifier">async_write</span></code></a>
support both the <code class="computeroutput"><span class="identifier">DynamicBuffer_v1</span></code>
and the <a class="link" href="reference/DynamicBuffer_v2.html" title="Dynamic buffer requirements (version 2)"><code class="computeroutput"><span class="identifier">DynamicBuffer_v2</span></code></a> type requirements
for dynamic buffers.
</p>
<p>
When <code class="computeroutput"><span class="identifier">ASIO_NO_DYNAMIC_BUFFER_V1</span></code>
is defined, all support for <code class="computeroutput"><span class="identifier">DynamicBuffer_v1</span></code>
types and functions is #ifdef-ed out. Support for using <a class="link" href="reference/basic_streambuf.html" title="basic_streambuf"><code class="computeroutput"><span class="identifier">basic_streambuf</span></code></a> with the
<code class="computeroutput"><span class="identifier">read</span></code>, <code class="computeroutput"><span class="identifier">async_read</span></code>, <code class="computeroutput"><span class="identifier">read_until</span></code>,
<code class="computeroutput"><span class="identifier">async_read_until</span></code>,
<code class="computeroutput"><span class="identifier">write</span></code>, and <code class="computeroutput"><span class="identifier">async_write</span></code> functions is also disabled
as a consequence.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_ENABLE_BUFFER_DEBUGGING</span></code>
</p>
</td>
<td>
<p>
Enables Asio's buffer debugging support, which can help identify
when invalid buffers are used in read or write operations (e.g. if
a std::string object being written is destroyed before the write
operation completes).
</p>
<p>
When using Microsoft Visual C++ 11.0 or later, this macro is defined
automatically if the compiler's iterator debugging support is enabled,
unless <code class="computeroutput"><span class="identifier">ASIO_DISABLE_BUFFER_DEBUGGING</span></code>
has been defined.
</p>
<p>
When using g++, this macro is defined automatically if standard library
debugging is enabled (<code class="computeroutput"><span class="identifier">_GLIBCXX_DEBUG</span></code>
is defined), unless <code class="computeroutput"><span class="identifier">ASIO_DISABLE_BUFFER_DEBUGGING</span></code>
has been defined.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BUFFER_DEBUGGING</span></code>
</p>
</td>
<td>
<p>
Explictly disables Asio's buffer debugging support.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_ENABLE_HANDLER_TRACKING</span></code>
</p>
</td>
<td>
<p>
Enables Asio's <a class="link" href="overview/core/handler_tracking.html" title="Handler Tracking">Handler
Tracking</a> debugging facility.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_DEV_POLL</span></code>
</p>
</td>
<td>
<p>
Explicitly disables <code class="literal">/dev/poll</code> support on Solaris,
forcing the use of a <code class="computeroutput"><span class="identifier">select</span></code>-based
implementation.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_EPOLL</span></code>
</p>
</td>
<td>
<p>
Explicitly disables <code class="computeroutput"><span class="identifier">epoll</span></code>
support on Linux, forcing the use of a <code class="computeroutput"><span class="identifier">select</span></code>-based
implementation.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_EVENTFD</span></code>
</p>
</td>
<td>
<p>
Explicitly disables <code class="computeroutput"><span class="identifier">eventfd</span></code>
support on Linux, forcing the use of a pipe to interrupt blocked
epoll/select system calls.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_KQUEUE</span></code>
</p>
</td>
<td>
<p>
Explicitly disables <code class="computeroutput"><span class="identifier">kqueue</span></code>
support on macOS and BSD variants, forcing the use of a <code class="computeroutput"><span class="identifier">select</span></code>-based implementation.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_IOCP</span></code>
</p>
</td>
<td>
<p>
Explicitly disables I/O completion ports support on Windows, forcing
the use of a <code class="computeroutput"><span class="identifier">select</span></code>-based
implementation.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_THREADS</span></code>
</p>
</td>
<td>
<p>
Explicitly disables Asio's threading support, independent of whether
or not Boost supports threads.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_WIN32_LEAN_AND_MEAN</span></code>
</p>
</td>
<td>
<p>
By default, Asio will automatically define <code class="computeroutput"><span class="identifier">WIN32_LEAN_AND_MEAN</span></code>
when compiling for Windows, to minimise the number of Windows SDK
header files and features that are included. The presence of <code class="computeroutput"><span class="identifier">ASIO_NO_WIN32_LEAN_AND_MEAN</span></code> prevents
<code class="computeroutput"><span class="identifier">WIN32_LEAN_AND_MEAN</span></code>
from being defined.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_NOMINMAX</span></code>
</p>
</td>
<td>
<p>
By default, Asio will automatically define <code class="computeroutput"><span class="identifier">NOMINMAX</span></code>
when compiling for Windows, to suppress the definition of the <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code>
and <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code>
macros. The presence of <code class="computeroutput"><span class="identifier">ASIO_NO_NOMINMAX</span></code>
prevents <code class="computeroutput"><span class="identifier">NOMINMAX</span></code>
from being defined.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_DEFAULT_LINKED_LIBS</span></code>
</p>
</td>
<td>
<p>
When compiling for Windows using Microsoft Visual C++ or Borland
C++, Asio will automatically link in the necessary Windows SDK libraries
for sockets support (i.e. <code class="literal">ws2_32.lib</code> and <code class="literal">mswsock.lib</code>,
or <code class="literal">ws2.lib</code> when building for Windows CE). The
<code class="computeroutput"><span class="identifier">ASIO_NO_DEFAULT_LINKED_LIBS</span></code>
macro prevents these libraries from being linked.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_ENABLE_CANCELIO</span></code>
</p>
</td>
<td>
<p>
Enables use of the <code class="computeroutput"><span class="identifier">CancelIo</span></code>
function on older versions of Windows. If not enabled, calls to
<code class="computeroutput"><span class="identifier">cancel</span><span class="special">()</span></code>
on a socket object will always fail with <code class="computeroutput"><span class="identifier">asio</span><span class="special">::</span><span class="identifier">error</span><span class="special">::</span><span class="identifier">operation_not_supported</span></code>
when run on Windows XP, Windows Server 2003, and earlier versions
of Windows. When running on Windows Vista, Windows Server 2008, and
later, the <code class="computeroutput"><span class="identifier">CancelIoEx</span></code>
function is always used.
</p>
<p>
The <code class="computeroutput"><span class="identifier">CancelIo</span></code> function
has two issues that should be considered before enabling its use:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
It will only cancel asynchronous operations that were initiated
in the current thread.
</li>
<li class="listitem">
<p class="simpara">
It can appear to complete without error, but the request to cancel
the unfinished operations may be silently ignored by the operating
system. Whether it works or not seems to depend on the drivers
that are installed.
</p>
<p class="simpara">
For portable cancellation, consider using one of the following
alternatives:
</p>
</li>
<li class="listitem">
Disable asio's I/O completion port backend by defining ASIO_DISABLE_IOCP.
</li>
<li class="listitem">
Use the socket object's close() function to simultaneously cancel
the outstanding operations and close the socket.
</li>
</ul></div>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_NO_TYPEID</span></code>
</p>
</td>
<td>
<p>
Disables uses of the <code class="computeroutput"><span class="keyword">typeid</span></code>
operator in asio. Defined automatically if <code class="computeroutput"><span class="identifier">BOOST_NO_TYPEID</span></code>
is defined.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HASH_MAP_BUCKETS</span></code>
</p>
</td>
<td>
<p>
Determines the number of buckets in asio's internal <code class="computeroutput"><span class="identifier">hash_map</span></code> objects. The value should
be a comma separated list of prime numbers, in ascending order. The
<code class="computeroutput"><span class="identifier">hash_map</span></code> implementation
will automatically increase the number of buckets as the number of
elements in the map increases.
</p>
<p>
Some examples:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
Defining <code class="computeroutput"><span class="identifier">ASIO_HASH_MAP_BUCKETS</span></code>
to <code class="computeroutput"><span class="number">1021</span></code> means that
the <code class="computeroutput"><span class="identifier">hash_map</span></code>
objects will always contain 1021 buckets, irrespective of the
number of elements in the map.
</li>
<li class="listitem">
Defining <code class="computeroutput"><span class="identifier">ASIO_HASH_MAP_BUCKETS</span></code>
to <code class="computeroutput"><span class="number">53</span><span class="special">,</span><span class="number">389</span><span class="special">,</span><span class="number">1543</span></code> means that the <code class="computeroutput"><span class="identifier">hash_map</span></code> objects will initially
contain 53 buckets. The number of buckets will be increased to
389 and then 1543 as elements are added to the map.
</li>
</ul></div>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM</span></code>
</p>
</td>
<td>
<p>
Changes <a class="link" href="reference/basic_socket_streambuf.html" title="basic_socket_streambuf"><code class="computeroutput"><span class="identifier">basic_socket_streambuf</span></code></a> and
<a class="link" href="reference/basic_socket_iostream.html" title="basic_socket_iostream"><code class="computeroutput"><span class="identifier">basic_socket_iostream</span></code></a> to
use the old Boost.Date_Time interface, rather than chrono.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_SEPARATE_COMPILATION</span></code>
</p>
</td>
<td>
<p>
Uses separately compiled source code for Asio's implementation.
</p>
<p>
See <a class="link" href="using.html#asio.using.optional_separate_compilation">above</a>
for further information.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DYN_LINK</span></code>
</p>
</td>
<td>
<p>
Uses separately compiled source code for Asio's implementation, with
symbols exported for inclusion as part of a shared library.
</p>
<p>
See <a class="link" href="using.html#asio.using.optional_separate_compilation">above</a>
for further information.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_VISIBILITY</span></code>
</p>
</td>
<td>
<p>
Disables all symbol visibility pragmas.
</p>
<p>
Note: If symbols are hidden, extra care must be taken to ensure that
Asio types are not passed across shared library API boundaries.
</p>
</td>
</tr>
</tbody>
</table></div>
<h4>
<a name="asio.using.h8"></a>
<span><a name="asio.using.compiler_platform_feature_detection_macros"></a></span><a class="link" href="using.html#asio.using.compiler_platform_feature_detection_macros">Compiler/platform
feature detection macros</a>
</h4>
<p>
Asio automatically defines preprocessor macros corresponding to the detected
available features on a particular compiler and target platform. These macros
are named with the prefix <code class="computeroutput"><span class="identifier">ASIO_HAS_</span></code>,
and are listed in the table below.
</p>
<p>
Many of these macros also have a corresponding <code class="computeroutput"><span class="identifier">ASIO_DISABLE_</span></code>
macro that may be used to explicitly disable the feature.
</p>
<p>
In general, <code class="computeroutput"><span class="identifier">ASIO_HAS_</span></code> macros
should not be explicitly defined by the user, except when absolutely required
as a workaround for the latest version of a compiler or platform. For older
compiler/platform combinations where a specific <code class="computeroutput"><span class="identifier">ASIO_HAS_</span></code>
macro is not automatically defined, testing may have shown that a claimed feature
isn't sufficiently conformant to be compatible with Asio's needs.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Macro
</p>
</th>
<th>
<p>
Description
</p>
</th>
<th>
<p>
Macro to disable feature
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_ALIAS_TEMPLATES</span></code>
</p>
</td>
<td>
<p>
Support alias templates on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_ALIAS_TEMPLATES</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_ALIGNOF</span></code>
</p>
</td>
<td>
<p>
Support for the alignof operator.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_ALIGNOF</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_ALIGN</span></code>
</p>
</td>
<td>
<p>
Boost align library.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_ALIGN</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_ARRAY</span></code>
</p>
</td>
<td>
<p>
Boost array library.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_ARRAY</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_ASSERT</span></code>
</p>
</td>
<td>
<p>
Boost assert macro.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_ASSERT</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_BIND</span></code>
</p>
</td>
<td>
<p>
Boost bind function.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_BIND</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_CHRONO</span></code>
</p>
</td>
<td>
<p>
Boost support for chrono.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_CHRONO</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_CONFIG</span></code>
</p>
</td>
<td>
<p>
Boost.Config library is available.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_CONTEXT_FIBER</span></code>
</p>
</td>
<td>
<p>
Boost support for the Context library's fibers.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_CONTEXT_FIBER</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_COROUTINE</span></code>
</p>
</td>
<td>
<p>
Boost support for the Coroutine library.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_COROUTINE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_DATE_TIME</span></code>
</p>
</td>
<td>
<p>
Boost support for the DateTime library.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_DATE_TIME</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_LIMITS</span></code>
</p>
</td>
<td>
<p>
Boost limits header.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_LIMITS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_REGEX</span></code>
</p>
</td>
<td>
<p>
Boost regex library.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_REGEX</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_SOURCE_LOCATION</span></code>
</p>
</td>
<td>
<p>
Boost support for source_location and system errors.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_SOURCE_LOCATION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_THROW_EXCEPTION</span></code>
</p>
</td>
<td>
<p>
Boost throw_exception function.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_THROW_EXCEPTION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_BOOST_WORKAROUND</span></code>
</p>
</td>
<td>
<p>
Boost's BOOST_WORKAROUND macro.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_BOOST_WORKAROUND</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CHRONO</span></code>
</p>
</td>
<td>
<p>
Some form of chrono library is available.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CLANG_LIBCXX</span></code>
</p>
</td>
<td>
<p>
Clang / libc++ detection.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CONCEPTS</span></code>
</p>
</td>
<td>
<p>
Support concepts on compilers known to allow them.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_CONCEPTS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CONSTANT_EXPRESSION_SFINAE</span></code>
</p>
</td>
<td>
<p>
Support SFINAE use of constant expressions on compilers known to
allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_CONSTANT_EXPRESSION_SFINAE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CONSTEXPR</span></code>
</p>
</td>
<td>
<p>
Support constexpr on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_CONSTEXPR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CO_AWAIT</span></code>
</p>
</td>
<td>
<p>
Support the co_await keyword on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_CO_AWAIT</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CSTDINT</span></code>
</p>
</td>
<td>
<p>
Standard library support for the cstdint header.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_CSTDINT</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_CXX11_ALLOCATORS</span></code>
</p>
</td>
<td>
<p>
Standard library support for the C++11 allocator additions.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_CXX11_ALLOCATORS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_DECLTYPE</span></code>
</p>
</td>
<td>
<p>
Support automatic type deduction on compilers known to support it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_DECLTYPE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS</span></code>
</p>
</td>
<td>
<p>
Support default function template arguments on compilers known to
allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_DEV_POLL</span></code>
</p>
</td>
<td>
<p>
Solaris: /dev/poll.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_DEV_POLL</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_ENUM_CLASS</span></code>
</p>
</td>
<td>
<p>
Support enum classes on compilers known to allow them.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_ENUM_CLASS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_EPOLL</span></code>
</p>
</td>
<td>
<p>
Linux: epoll, eventfd and timerfd.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_EPOLL</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_EVENTFD</span></code>
</p>
</td>
<td>
<p>
Linux: epoll, eventfd and timerfd.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_EVENTFD</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_FILE</span></code>
</p>
</td>
<td>
<p>
Files.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_FILE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_GETADDRINFO</span></code>
</p>
</td>
<td>
<p>
Can use getaddrinfo() and getnameinfo().
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_GETADDRINFO</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_HANDLER_HOOKS</span></code>
</p>
</td>
<td>
<p>
Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_HANDLER_HOOKS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_IOCP</span></code>
</p>
</td>
<td>
<p>
Windows: IO Completion Ports.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_IOCP</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_IO_URING_AS_DEFAULT</span></code>
</p>
</td>
<td>
<p>
Linux: io_uring is used instead of epoll.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_KQUEUE</span></code>
</p>
</td>
<td>
<p>
Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_KQUEUE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_LOCAL_SOCKETS</span></code>
</p>
</td>
<td>
<p>
UNIX domain sockets.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_LOCAL_SOCKETS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_MOVE</span></code>
</p>
</td>
<td>
<p>
Support move construction and assignment on compilers known to allow
it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_MOVE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_MSG_NOSIGNAL</span></code>
</p>
</td>
<td>
<p>
Kernel support for MSG_NOSIGNAL.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_NOEXCEPT</span></code>
</p>
</td>
<td>
<p>
Support noexcept on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_NOEXCEPT</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_NOEXCEPT_FUNCTION_TYPE</span></code>
</p>
</td>
<td>
<p>
Support noexcept on function types on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_NOEXCEPT_FUNCTION_TYPE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_NULLPTR</span></code>
</p>
</td>
<td>
<p>
Standard library support for the nullptr_t type.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_NULLPTR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_PIPE</span></code>
</p>
</td>
<td>
<p>
Pipes.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_PIPE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_POSIX_STREAM_DESCRIPTOR</span></code>
</p>
</td>
<td>
<p>
POSIX: stream-oriented file descriptors.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_PTHREADS</span></code>
</p>
</td>
<td>
<p>
POSIX threads.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_REF_QUALIFIED_FUNCTIONS</span></code>
</p>
</td>
<td>
<p>
Support ref-qualified functions on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_REF_QUALIFIED_FUNCTIONS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_RETURN_TYPE_DEDUCTION</span></code>
</p>
</td>
<td>
<p>
Support return type deduction on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_RETURN_TYPE_DEDUCTION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SECURE_RTL</span></code>
</p>
</td>
<td>
<p>
Microsoft Visual C++'s secure C runtime library.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SECURE_RTL</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SERIAL_PORT</span></code>
</p>
</td>
<td>
<p>
Serial ports.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SERIAL_PORT</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SFINAE_VARIABLE_TEMPLATES</span></code>
</p>
</td>
<td>
<p>
Support SFINAEd template variables on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SFINAE_VARIABLE_TEMPLATES</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SIGACTION</span></code>
</p>
</td>
<td>
<p>
Can use sigaction() instead of signal().
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SIGACTION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SIGNAL</span></code>
</p>
</td>
<td>
<p>
Can use signal().
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SIGNAL</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SOURCE_LOCATION</span></code>
</p>
</td>
<td>
<p>
Standard library has a source_location that we can use.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SOURCE_LOCATION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_SSIZE_T</span></code>
</p>
</td>
<td>
<p>
Support for POSIX ssize_t typedef.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_SSIZE_T</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_ADDRESSOF</span></code>
</p>
</td>
<td>
<p>
Standard library support for addressof.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_ADDRESSOF</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_ALIGNED_ALLOC</span></code>
</p>
</td>
<td>
<p>
Standard library support for aligned allocation.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_ALIGNED_ALLOC</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_ALLOCATOR_ARG</span></code>
</p>
</td>
<td>
<p>
Standard library support for allocator_arg_t.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_ALLOCATOR_ARG</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_ANY</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::any.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_ANY</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_ARRAY</span></code>
</p>
</td>
<td>
<p>
Standard library support for arrays.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_ARRAY</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_ATOMIC</span></code>
</p>
</td>
<td>
<p>
Standard library support for atomic operations.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_ATOMIC</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_CALL_ONCE</span></code>
</p>
</td>
<td>
<p>
Standard library support for the call_once function.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_CALL_ONCE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_CHRONO</span></code>
</p>
</td>
<td>
<p>
Standard library support for chrono. Some standard libraries (such
as the libstdc++ shipped with gcc 4.6) provide monotonic_clock as
per early C++0x drafts, rather than the eventually standardised name
of steady_clock.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_CHRONO</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK</span></code>
</p>
</td>
<td>
<p>
Standard library support for chrono. Some standard libraries (such
as the libstdc++ shipped with gcc 4.6) provide monotonic_clock as
per early C++0x drafts, rather than the eventually standardised name
of steady_clock.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_CONCEPTS</span></code>
</p>
</td>
<td>
<p>
Support concepts on compilers known to allow them.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_CONCEPTS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_COROUTINE</span></code>
</p>
</td>
<td>
<p>
Standard library support for coroutines.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_COROUTINE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_EXCEPTION_PTR</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::exception_ptr and std::current_exception.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_EXCEPTION_PTR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_EXPERIMENTAL_SOURCE_LOCATION</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::experimental::source_location.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_EXPERIMENTAL_SOURCE_LOCATION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::experimental::string_view.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_FUNCTION</span></code>
</p>
</td>
<td>
<p>
Standard library support for the function class.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_FUNCTION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_FUTURE</span></code>
</p>
</td>
<td>
<p>
Standard library support for futures.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_FUTURE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_HASH</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::hash.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_HASH</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_INDEX_SEQUENCE</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::index_sequence.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_INDEX_SEQUENCE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_INVOKE_RESULT</span></code>
</p>
</td>
<td>
<p>
Standard library has invoke_result (which supersedes result_of).
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_INVOKE_RESULT</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_IOSTREAM_MOVE</span></code>
</p>
</td>
<td>
<p>
Standard library support for iostream move construction and assignment.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_IOSTREAM_MOVE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_MUTEX_AND_CONDVAR</span></code>
</p>
</td>
<td>
<p>
Standard library support for the mutex and condition variable classes.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_MUTEX_AND_CONDVAR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_NESTED_EXCEPTION</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::nested_exception.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_NESTED_EXCEPTION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_REFERENCE_WRAPPER</span></code>
</p>
</td>
<td>
<p>
Standard library support for the reference_wrapper class.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_REFERENCE_WRAPPER</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_SHARED_PTR</span></code>
</p>
</td>
<td>
<p>
Standard library support for shared_ptr and weak_ptr.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_SHARED_PTR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_STRING_VIEW</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::string_view.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_STRING_VIEW</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_SYSTEM_ERROR</span></code>
</p>
</td>
<td>
<p>
Standard library support for system errors.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_SYSTEM_ERROR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_THREAD</span></code>
</p>
</td>
<td>
<p>
Standard library support for the thread class.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_THREAD</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_TO_ADDRESS</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::to_address.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_TO_ADDRESS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_TUPLE</span></code>
</p>
</td>
<td>
<p>
Standard library support for std::tuple.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_TUPLE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STD_TYPE_TRAITS</span></code>
</p>
</td>
<td>
<p>
Standard library support for type traits.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STD_TYPE_TRAITS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_STRING_VIEW</span></code>
</p>
</td>
<td>
<p>
Standard library has a string_view that we can use.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_STRING_VIEW</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_THREADS</span></code>
</p>
</td>
<td>
<p>
Threads.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_THREADS</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_THREAD_KEYWORD_EXTENSION</span></code>
</p>
</td>
<td>
<p>
Support for the __thread keyword extension.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_THREAD_KEYWORD_EXTENSION</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_TIMERFD</span></code>
</p>
</td>
<td>
<p>
Linux: epoll, eventfd and timerfd.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_UNISTD_H</span></code>
</p>
</td>
<td>
<p>
On POSIX (and POSIX-like) platforms we need to include unistd.h in
order to get access to the various platform feature macros, e.g.
to be able to test for threads support.
</p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_VARIABLE_TEMPLATES</span></code>
</p>
</td>
<td>
<p>
Support template variables on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_VARIABLE_TEMPLATES</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_VARIADIC_LAMBDA_CAPTURES</span></code>
</p>
</td>
<td>
<p>
Support for capturing parameter packs in lambdas.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_VARIADIC_LAMBDA_CAPTURES</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_VARIADIC_TEMPLATES</span></code>
</p>
</td>
<td>
<p>
Support variadic templates on compilers known to allow it.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_VARIADIC_TEMPLATES</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_WINDOWS_OBJECT_HANDLE</span></code>
</p>
</td>
<td>
<p>
Windows: object handles.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_WINDOWS_OBJECT_HANDLE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_WINDOWS_OVERLAPPED_PTR</span></code>
</p>
</td>
<td>
<p>
Windows: OVERLAPPED wrapper.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE</span></code>
</p>
</td>
<td>
<p>
Windows: random access handles.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_WINDOWS_STREAM_HANDLE</span></code>
</p>
</td>
<td>
<p>
Windows: stream handles.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_WINDOWS_STREAM_HANDLE</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_HAS_WORKING_EXPRESSION_SFINAE</span></code>
</p>
</td>
<td>
<p>
Enable workarounds for lack of working expression SFINAE.
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">ASIO_DISABLE_WORKING_EXPRESSION_SFINAE</span></code>
</p>
</td>
</tr>
</tbody>
</table></div>
<h4>
<a name="asio.using.h9"></a>
<span><a name="asio.using.mailing_list"></a></span><a class="link" href="using.html#asio.using.mailing_list">Mailing
List</a>
</h4>
<p>
A mailing list specifically for Asio may be found on <a href="http://sourceforge.net/mail/?group_id=122478" target="_top">SourceForge.net</a>.
Newsgroup access is provided via <a href="http://dir.gmane.org/gmane.comp.lib.boost.asio.user" target="_top">Gmane</a>.
</p>
</div>
<div class="copyright-footer">Copyright © 2003-2023 Christopher M. Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overview/implementation.html"><img src="../prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../next.png" alt="Next"></a>
</div>
</body>
</html>