• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>prefer</title>
5<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../boost_asio.html" title="Boost.Asio">
8<link rel="up" href="../reference.html" title="Reference">
9<link rel="prev" href="post/overload3.html" title="post (3 of 3 overloads)">
10<link rel="next" href="prefer_result.html" title="prefer_result">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15<td align="center"><a href="../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="post/overload3.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="prefer_result.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="boost_asio.reference.prefer"></a><a class="link" href="prefer.html" title="prefer">prefer</a>
28</h3></div></div></div>
29<p>
30        <a class="indexterm" name="boost_asio.indexterm.prefer"></a>
31A customisation point that attempts to apply
32        a property to an object.
33      </p>
34<pre class="programlisting">constexpr unspecified prefer = unspecified;
35</pre>
36<p>
37        The name <code class="computeroutput">prefer</code> denotes a customisation point object. The expression
38        <code class="computeroutput">boost::asio::prefer(E, P0, Pn...)</code> for some subexpressions <code class="computeroutput">E</code>
39        and <code class="computeroutput">P0</code>, and where <code class="computeroutput">Pn...</code> represents <code class="computeroutput">N</code>
40        subexpressions (where <code class="computeroutput">N</code> is 0 or more, and with types <code class="computeroutput">T
41        = decay_t&lt;decltype(E)&gt;</code> and <code class="computeroutput">Prop0 = decay_t&lt;decltype(P0)&gt;</code>)
42        is expression-equivalent to:
43      </p>
44<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
45<li class="listitem">
46            If <code class="computeroutput">is_applicable_property_v&lt;T, Prop0&gt; &amp;&amp; Prop0::is_preferable</code>
47            is not a well-formed constant expression with value <code class="computeroutput">true</code>,
48            <code class="computeroutput">boost::asio::prefer(E, P0, Pn...)</code> is ill-formed.
49          </li>
50<li class="listitem">
51            Otherwise, <code class="computeroutput">E</code> if <code class="computeroutput">N == 0</code> and the expression
52            <code class="computeroutput">Prop0::template static_query_v&lt;T&gt; == Prop0::value()</code>
53            is a well-formed constant expression with value <code class="computeroutput">true</code>.
54          </li>
55<li class="listitem">
56            Otherwise, <code class="computeroutput">(E).require(P0)</code> if <code class="computeroutput">N == 0</code> and the
57            expression <code class="computeroutput">(E).require(P0)</code> is a valid expression.
58          </li>
59<li class="listitem">
60            Otherwise, <code class="computeroutput">require(E, P0)</code> if <code class="computeroutput">N == 0</code> and the
61            expression <code class="computeroutput">require(E, P0)</code> is a valid expression with overload
62            resolution performed in a context that does not include the declaration
63            of the <code class="computeroutput">require</code> customization point object.
64          </li>
65<li class="listitem">
66            Otherwise, <code class="computeroutput">(E).prefer(P0)</code> if <code class="computeroutput">N == 0</code> and the
67            expression <code class="computeroutput">(E).prefer(P0)</code> is a valid expression.
68          </li>
69<li class="listitem">
70            Otherwise, <code class="computeroutput">prefer(E, P0)</code> if <code class="computeroutput">N == 0</code> and the
71            expression <code class="computeroutput">prefer(E, P0)</code> is a valid expression with overload
72            resolution performed in a context that does not include the declaration
73            of the <code class="computeroutput">prefer</code> customization point object.
74          </li>
75<li class="listitem">
76            Otherwise, <code class="computeroutput">E</code> if <code class="computeroutput">N == 0</code>.
77          </li>
78<li class="listitem">
79            Otherwise, <code class="computeroutput">boost::asio::prefer(boost::asio::prefer(E, P0), Pn...)</code>
80            if <code class="computeroutput">N &gt; 0</code> and the expression <code class="computeroutput">boost::asio::prefer(boost::asio::prefer(E,
81            P0), Pn...)</code> is a valid expression.
82          </li>
83<li class="listitem">
84            Otherwise, <code class="computeroutput">boost::asio::prefer(E, P0, Pn...)</code> is ill-formed.
85          </li>
86</ul></div>
87<h5>
88<a name="boost_asio.reference.prefer.h0"></a>
89        <span class="phrase"><a name="boost_asio.reference.prefer.requirements"></a></span><a class="link" href="prefer.html#boost_asio.reference.prefer.requirements">Requirements</a>
90      </h5>
91<p>
92        <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/prefer.hpp</code>
93      </p>
94<p>
95        <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio.hpp</code>
96      </p>
97</div>
98<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
99<td align="left"></td>
100<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M.
101      Kohlhoff<p>
102        Distributed under the Boost Software License, Version 1.0. (See accompanying
103        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>)
104      </p>
105</div></td>
106</tr></table>
107<hr>
108<div class="spirit-nav">
109<a accesskey="p" href="post/overload3.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="prefer_result.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
110</div>
111</body>
112</html>
113