<!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 Page</span></a></li> <li><a href="pages.html"><span>Related 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 List</span></a></li> <li><a href="globals.html"><span>File 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> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright 2018-present Facebook, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <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> <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> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <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> <span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <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> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <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> <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> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> */</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <<a class="code" href="experimental_2pushmi_2traits_8h.html">folly/experimental/pushmi/traits.h</a>></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <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> <span class="keyword">namespace </span>pushmi {</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <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> (<a class="code" href="namespacefolly_1_1pushmi.html#a7f7639c807eb36c4cd1929d1f4c6aa0f">requires</a> lazy::Sender<std::decay_t<In>>&& lazy::Invocable<Op&, In>)</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="namespacefolly_1_1pushmi.html#a1a217ba0b14bffca499026c5e219f299"> 25</a></span> decltype(<span class="keyword">auto</span>) <a class="code" href="namespacefolly_1_1pushmi.html#a1a217ba0b14bffca499026c5e219f299">operator|</a>(In&& 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>  <span class="keywordflow">return</span> op((In &&) in);</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> }</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </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> <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> <span class="preprocessor">#if __cpp_fold_expressions >= 201603</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keyword">template</span> <<span class="keyword">class </span><a class="code" href="namespacefolly.html#a0652a9c51b69e7a13d40ccbcb139bc55">T</a>, <span class="keyword">class</span>... FN></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <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> -> decltype((t | ... | fn)) {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keywordflow">return</span> (t | ... | fn);</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keyword">template</span> <<span class="keyword">class</span> T, <span class="keyword">class</span> F></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>  <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> -> 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>  <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>  }</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keyword">template</span> <<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>></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>  <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>  -> decltype(This()((t | f), fn...)) {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <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>  }</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> } <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> </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> } <span class="comment">// namespace pushmi</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> } <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< std::decay_t< In > > &&decltype(auto) lazy::Invocable< Op &, In > operator|(In &&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 && 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 -> 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< F >(), std::declval< Tuple >(), detail::tupidxs< Tuple >{}))) const expr decltype(auto) apply(F &&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 -> 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< 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>