<html><head><meta charset="UTF-8">
<title>Variable templates for Networking TS traits</title>
  <style type='text/css'>
  body {font-variant-ligatures: none;}
  p {text-align:justify}
  li {text-align:justify}
  blockquote.note, div.note
  {
          background-color:#E0E0E0;
          padding-left: 15px;
          padding-right: 15px;
          padding-top: 1px;
          padding-bottom: 1px;
  }
  p code {color:navy}
  ins p code {color:#00A000}
  p ins code {color:#00A000}
  p del code {color:#A00000}
  ins {color:#00A000}
  del {color:#A00000}
  table#boilerplate { border:0 }
  table#boilerplate td { padding-left: 2em }
  table.bordered, table.bordered th, table.bordered td {
    border: 1px solid;
    text-align: center;
  }
  ins.block {color:#00A000; text-decoration: none}
  del.block {color:#A00000; text-decoration: none}
  </style>
</head><body>
<table id="boilerplate">
<tr><td>Document number</td><td>P0423R0</td></tr>
<tr><td>Date</td><td>2016-08-04</td></tr>
<tr><td>Project</td><td>Programming Language C++, Library Working Group</td></tr>
<tr><td>Reply-to</td><td>Jonathan Wakely &lt;cxx&#x40;kayari.org&gt;</td></tr>
</table><hr>
<h1>Variable templates for Networking TS traits</h1>
<p>The Networking TS defines type traits such as <code>is_executor</code> but does not provide
corresponding variable templates such as <code>is_executor_v</code>. The direction set
by C++17 is to provide these, so the TS should define them.</p>

<h2>Proposed Wording</h2>

<p>Add to 13.1 [async.synop] synopsis:</p>

<pre><code>    template&lt;class T&gt; struct is_executor;

    <ins>template&lt;class T&gt;</ins>
      <ins>constexpr bool is_executor_v = is_executor&lt;T&gt;::value;</ins>

    struct executor_arg_t { };
    constexpr executor_arg_t executor_arg = executor_arg_t();

    template&lt;class T, class Executor&gt; struct uses_executor;

    <ins>template&lt;class T, class Executor&gt;</ins>
      <ins>constexpr bool uses_executor_v = uses_executor&lt;T, Executor&gt;::value;</ins>

    template&lt;class T, class Executor = system_executor&gt;
      struct associated_executor;
</code></pre>

<p>Add to 16.1 [buffer.synop] synopsis:</p>

<pre><code>    // buffer type traits:

    template&lt;class T&gt; is_mutable_buffer_sequence;
    template&lt;class T&gt; is_const_buffer_sequence;
    template&lt;class T&gt; is_dynamic_buffer;

    <ins>template&lt;class T&gt;</ins>
      <ins>constexpr bool is_mutable_buffer_sequence_v = is_mutable_buffer_sequence&lt;T&gt;::value;</ins>
    <ins>template&lt;class T&gt;</ins>
      <ins>constexpr bool is_const_buffer_sequence_v = is_const_buffer_sequence&lt;T&gt;::value;</ins>
    <ins>template&lt;class T&gt;</ins>
      <ins>constexpr bool is_dynamic_buffer_v = is_dynamic_buffer&lt;T&gt;::value;</ins>

    // buffer sequence access:
</code></pre>
</body></html>
