<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 1513: 'launch' enum too restrictive</title>
<meta property="og:title" content="Issue 1513: 'launch' enum too restrictive">
<meta property="og:description" content="C++ library issue. Status: Resolved">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue1513.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#Resolved">Resolved</a> status.</em></p>
<h3 id="1513"><a href="lwg-defects.html#1513">1513</a>. 'launch' enum too restrictive</h3>
<p><b>Section:</b> 32.10 <a href="https://wg21.link/futures">[futures]</a> <b>Status:</b> <a href="lwg-active.html#Resolved">Resolved</a>
 <b>Submitter:</b> Switzerland <b>Opened:</b> 2010-08-25 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="lwg-index.html#futures">issues</a> in [futures].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Resolved">Resolved</a> status.</p>
<p><b>Discussion:</b></p>
<p><b>Addresses CH-36</b></p>
<p>
Providing only three different possible values for the enum
<code>launch</code> and saying that <code>launch::any</code> means either
<code>launch::sync</code> or <code>launch::async</code> is very restricting. This
hinders future implementors to provide clever
infrastructures that can simply by used by a call to
<code>async(launch::any,...)</code>. Also there is no hook for an
implementation to provide additional alternatives to <code>launch</code>
enumeration and no useful means to combine those (i.e.
interpret them like flags). We believe something like
<code>async(launch::sync | launch::async, ...)</code> should be allowed
and can become especially useful if one could say also
something like <code>async(launch::any &amp; ~launch::sync, ....)</code>
respectively. This flexibility might limit the features usable
in the function called through <code>async()</code>, but it will allow a
path to effortless profit from improved hardware/software
without complicating the programming model when just
using <code>async(launch::any,...)</code>
</p>
<p><i>[
Resolution proposed by ballot comment:
]</i></p>

<p>
Change in 32.10.1 <a href="https://wg21.link/futures.overview">[futures.overview]</a> 'enum class launch' to allow
further implementation defined values and provide
the following bit-operators on the launch values
(<code>operator|</code>, <code>operator&amp;</code>, <code>operator~</code> delivering a
<code>launch</code> value).
<p/>
Note: a possible implementation might use an
unsigned value to represent the <code>launch</code> enums,
but we shouldn't limit the standard to just 32 or 64
available bits in that case and also should keep
the launch enums in their own enum namespace.
<p/>
Change [future.async] p3 according to the
changes to <code>enum launch</code>. change --<code>launch::any</code> to
"the implementation may choose any of the
policies it provides." Note: this can mean that an
implementation may restrict the called function to
take all required information by copy in case it will
be called in a different address space, or even, on
a different processor type. To ensure that a call is
either performed like <code>launch::async</code> or
<code>launch::sync</code> describe one should call
<code>async(launch::sync|launch::async,...)</code>
</p>

<p><i>[
2010-11-02 Daniel comments:
]</i></p>


<blockquote><p>
The new paper <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3113.html">n3113</a> provides concrete wording.
</p></blockquote>


<p id="res-1513"><b>Proposed resolution:</b></p>
<p>
Resolved by <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3188.htm">n3188</a>.
</p>





</body>
</html>
