<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>proxygen: proxygen/folly/folly/experimental/pushmi/piping.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">proxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('piping_8h_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">piping.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="piping_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright 2018-present Facebook, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="experimental_2pushmi_2traits_8h.html">folly/experimental/pushmi/traits.h</a>&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacefolly.html">folly</a> {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">namespace </span>pushmi {</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<a class="code" href="namespacefolly_1_1pushmi.html#a5450b64d05ff016624d94b2ce01fd543">PUSHMI_TEMPLATE</a>(<span class="keyword">class</span> In, <span class="keyword">class</span> <a class="code" href="namespacefolly_1_1detail_1_1function.html#ae6f93e257499e897fb9a10f6f9c30c2b">Op</a>)</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;(<a class="code" href="namespacefolly_1_1pushmi.html#a7f7639c807eb36c4cd1929d1f4c6aa0f">requires</a> lazy::Sender&lt;std::decay_t&lt;In&gt;&gt;&amp;&amp; lazy::Invocable&lt;Op&amp;, In&gt;)</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="namespacefolly_1_1pushmi.html#a1a217ba0b14bffca499026c5e219f299">   25</a></span>&#160;decltype(<span class="keyword">auto</span>) <a class="code" href="namespacefolly_1_1pushmi.html#a1a217ba0b14bffca499026c5e219f299">operator|</a>(In&amp;&amp; in, <a class="code" href="namespacefolly_1_1detail_1_1function.html#ae6f93e257499e897fb9a10f6f9c30c2b">Op</a> <a class="code" href="namespacefolly_1_1pushmi_1_1operators.html">op</a>) {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;  <span class="keywordflow">return</span> op((In &amp;&amp;) in);</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;}</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structfolly_1_1pushmi_1_1pipe__fn.html">   29</a></span>&#160;<a class="code" href="concept__def_8h.html#a7e587826574289ae40738878ea1f883c">PUSHMI_INLINE_VAR</a> constexpr <span class="keyword">struct </span><a class="code" href="structfolly_1_1pushmi_1_1pipe__fn.html">pipe_fn</a> {</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#if __cpp_fold_expressions &gt;= 201603</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">class </span><a class="code" href="namespacefolly.html#a0652a9c51b69e7a13d40ccbcb139bc55">T</a>, <span class="keyword">class</span>... FN&gt;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  <span class="keyword">auto</span> <a class="code" href="structfolly_1_1pushmi_1_1pipe__fn.html#a3650ea341959125ce53b36bfe631e192">operator()</a>(T <a class="code" href="namespacefolly_1_1pushmi.html#a54014cd6c3067c11f077e7f69c4925a0">t</a>, FN... fn) <span class="keyword">const</span> -&gt; decltype((t | ... | fn)) {</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordflow">return</span> (t | ... | fn);</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  }</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">class</span> T, <span class="keyword">class</span> F&gt;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structfolly_1_1pushmi_1_1pipe__fn.html#a3650ea341959125ce53b36bfe631e192">   37</a></span>&#160;  <span class="keyword">auto</span> <a class="code" href="structfolly_1_1pushmi_1_1pipe__fn.html#a3650ea341959125ce53b36bfe631e192">operator()</a>(T t, F <a class="code" href="PushmiBenchmarks_8cpp.html#ad94c2c2f9fd35a12cc099962b7540071">f</a>) <span class="keyword">const</span> -&gt; decltype(t | <a class="code" href="PushmiBenchmarks_8cpp.html#ad94c2c2f9fd35a12cc099962b7540071">f</a>) {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">return</span> t | <a class="code" href="PushmiBenchmarks_8cpp.html#ad94c2c2f9fd35a12cc099962b7540071">f</a>;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  }</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">class </span><a class="code" href="namespacefolly.html#a0652a9c51b69e7a13d40ccbcb139bc55">T</a>, <span class="keyword">class </span>F, <span class="keyword">class</span>... FN, <span class="keyword">class </span>This = <a class="code" href="structfolly_1_1pushmi_1_1pipe__fn.html">pipe_fn</a>&gt;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structfolly_1_1pushmi_1_1pipe__fn.html#a0425069d762a832c1297572eb81ee1b9">   41</a></span>&#160;  <span class="keyword">auto</span> <a class="code" href="structfolly_1_1pushmi_1_1pipe__fn.html#a0425069d762a832c1297572eb81ee1b9">operator()</a>(T t, F <a class="code" href="PushmiBenchmarks_8cpp.html#ad94c2c2f9fd35a12cc099962b7540071">f</a>, FN... fn) <a class="code" href="namespaceupload.html#a985aa9a71de3eb507344df65700c696d">const</a></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;      -&gt; decltype(This()((t | f), fn...)) {</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keywordflow">return</span> This()((t | <a class="code" href="PushmiBenchmarks_8cpp.html#ad94c2c2f9fd35a12cc099962b7540071">f</a>), fn...);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  }</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;} <span class="keyword">const</span> <a class="code" href="namespacefolly_1_1pushmi.html#ae5404d2cb571364818a6bfa1762629c3">pipe</a>{};</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;} <span class="comment">// namespace pushmi</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;} <span class="comment">// namespace folly</span></div><div class="ttc" id="namespacefolly_1_1pushmi_html_a1a217ba0b14bffca499026c5e219f299"><div class="ttname"><a href="namespacefolly_1_1pushmi.html#a1a217ba0b14bffca499026c5e219f299">folly::pushmi::operator|</a></div><div class="ttdeci">requires lazy::Sender&lt; std::decay_t&lt; In &gt; &gt; &amp;&amp;decltype(auto) lazy::Invocable&lt; Op &amp;, In &gt; operator|(In &amp;&amp;in, Op op)</div><div class="ttdef"><b>Definition:</b> <a href="piping_8h_source.html#l00025">piping.h:25</a></div></div>
<div class="ttc" id="namespacefolly_1_1pushmi_html_ae5404d2cb571364818a6bfa1762629c3"><div class="ttname"><a href="namespacefolly_1_1pushmi.html#ae5404d2cb571364818a6bfa1762629c3">folly::pushmi::pipe</a></div><div class="ttdeci">PUSHMI_INLINE_VAR constexpr struct folly::pushmi::pipe_fn pipe</div></div>
<div class="ttc" id="PushmiBenchmarks_8cpp_html_ad94c2c2f9fd35a12cc099962b7540071"><div class="ttname"><a href="PushmiBenchmarks_8cpp.html#ad94c2c2f9fd35a12cc099962b7540071">f</a></div><div class="ttdeci">auto f</div><div class="ttdef"><b>Definition:</b> <a href="PushmiBenchmarks_8cpp_source.html#l00515">PushmiBenchmarks.cpp:515</a></div></div>
<div class="ttc" id="namespacefolly_1_1pushmi_html_a54014cd6c3067c11f077e7f69c4925a0"><div class="ttname"><a href="namespacefolly_1_1pushmi.html#a54014cd6c3067c11f077e7f69c4925a0">folly::pushmi::t</a></div><div class="ttdeci">requires Tuple &amp;&amp; t</div><div class="ttdef"><b>Definition:</b> <a href="extension__operators_8h_source.html#l00060">extension_operators.h:60</a></div></div>
<div class="ttc" id="experimental_2pushmi_2traits_8h_html"><div class="ttname"><a href="experimental_2pushmi_2traits_8h.html">traits.h</a></div></div>
<div class="ttc" id="namespacefolly_html_a0652a9c51b69e7a13d40ccbcb139bc55"><div class="ttname"><a href="namespacefolly.html#a0652a9c51b69e7a13d40ccbcb139bc55">folly::T</a></div><div class="ttdeci">folly::std T</div></div>
<div class="ttc" id="structfolly_1_1pushmi_1_1pipe__fn_html_a3650ea341959125ce53b36bfe631e192"><div class="ttname"><a href="structfolly_1_1pushmi_1_1pipe__fn.html#a3650ea341959125ce53b36bfe631e192">folly::pushmi::pipe_fn::operator()</a></div><div class="ttdeci">auto operator()(T t, F f) const -&gt; decltype(t|f)</div><div class="ttdef"><b>Definition:</b> <a href="piping_8h_source.html#l00037">piping.h:37</a></div></div>
<div class="ttc" id="namespacefolly_html"><div class="ttname"><a href="namespacefolly.html">folly</a></div><div class="ttdoc">—— Concurrent Priority Queue Implementation —— </div><div class="ttdef"><b>Definition:</b> <a href="AtomicBitSet_8h_source.html#l00029">AtomicBitSet.h:29</a></div></div>
<div class="ttc" id="structfolly_1_1pushmi_1_1pipe__fn_html"><div class="ttname"><a href="structfolly_1_1pushmi_1_1pipe__fn.html">folly::pushmi::pipe_fn</a></div><div class="ttdef"><b>Definition:</b> <a href="piping_8h_source.html#l00029">piping.h:29</a></div></div>
<div class="ttc" id="namespacefolly_1_1pushmi_1_1operators_html"><div class="ttname"><a href="namespacefolly_1_1pushmi_1_1operators.html">folly::pushmi::operators</a></div><div class="ttdef"><b>Definition:</b> <a href="bulk_8h_source.html#l00023">bulk.h:23</a></div></div>
<div class="ttc" id="concept__def_8h_html_a7e587826574289ae40738878ea1f883c"><div class="ttname"><a href="concept__def_8h.html#a7e587826574289ae40738878ea1f883c">PUSHMI_INLINE_VAR</a></div><div class="ttdeci">#define PUSHMI_INLINE_VAR</div><div class="ttdef"><b>Definition:</b> <a href="concept__def_8h_source.html#l00060">concept_def.h:60</a></div></div>
<div class="ttc" id="namespacefolly_1_1pushmi_html_a7f7639c807eb36c4cd1929d1f4c6aa0f"><div class="ttname"><a href="namespacefolly_1_1pushmi.html#a7f7639c807eb36c4cd1929d1f4c6aa0f">folly::pushmi::requires</a></div><div class="ttdeci">requires requires(detail::apply_impl(std::declval&lt; F &gt;(), std::declval&lt; Tuple &gt;(), detail::tupidxs&lt; Tuple &gt;{}))) const expr decltype(auto) apply(F &amp;&amp;f</div></div>
<div class="ttc" id="structfolly_1_1pushmi_1_1pipe__fn_html_a0425069d762a832c1297572eb81ee1b9"><div class="ttname"><a href="structfolly_1_1pushmi_1_1pipe__fn.html#a0425069d762a832c1297572eb81ee1b9">folly::pushmi::pipe_fn::operator()</a></div><div class="ttdeci">auto operator()(T t, F f, FN...fn) const -&gt; decltype(This()((t|f), fn...))</div><div class="ttdef"><b>Definition:</b> <a href="piping_8h_source.html#l00041">piping.h:41</a></div></div>
<div class="ttc" id="namespacefolly_1_1pushmi_html_a5450b64d05ff016624d94b2ce01fd543"><div class="ttname"><a href="namespacefolly_1_1pushmi.html#a5450b64d05ff016624d94b2ce01fd543">folly::pushmi::PUSHMI_TEMPLATE</a></div><div class="ttdeci">PUSHMI_TEMPLATE(class E=std::exception_ptr, class Wrapped)(requires Sender&lt; detail</div><div class="ttdef"><b>Definition:</b> <a href="executor_8h_source.html#l00102">executor.h:102</a></div></div>
<div class="ttc" id="namespaceupload_html_a985aa9a71de3eb507344df65700c696d"><div class="ttname"><a href="namespaceupload.html#a985aa9a71de3eb507344df65700c696d">upload.const</a></div><div class="ttdeci">const</div><div class="ttdef"><b>Definition:</b> <a href="fizz_2build___2gtest_2src_2gtest_2googlemock_2scripts_2upload_8py_source.html#l00398">upload.py:398</a></div></div>
<div class="ttc" id="namespacefolly_1_1detail_1_1function_html_ae6f93e257499e897fb9a10f6f9c30c2b"><div class="ttname"><a href="namespacefolly_1_1detail_1_1function.html#ae6f93e257499e897fb9a10f6f9c30c2b">folly::detail::function::Op</a></div><div class="ttdeci">Op</div><div class="ttdef"><b>Definition:</b> <a href="Function_8h_source.html#l00250">Function.h:250</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d333e33cf903653326082c1f32e03be5.html">proxygen</a></li><li class="navelem"><a class="el" href="dir_32ce190710b1753ff87b781fbaae9b47.html">folly</a></li><li class="navelem"><a class="el" href="dir_dcf8e1233ba68571c5027662569cd1d9.html">folly</a></li><li class="navelem"><a class="el" href="dir_81eb1dbd071cdd475d3d544204dd2893.html">experimental</a></li><li class="navelem"><a class="el" href="dir_95da60d4dd25016845c021644f02b10e.html">pushmi</a></li><li class="navelem"><a class="el" href="piping_8h.html">piping.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>