Micro template library A library for building device drivers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

127 lines
37 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.14"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>uTL: include/utl/utility/invoke.h Source File</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  18. $(document).ready(initResizable);
  19. /* @license-end */</script>
  20. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  21. <script type="text/javascript" src="search/searchdata.js"></script>
  22. <script type="text/javascript" src="search/search.js"></script>
  23. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  24. </head>
  25. <body>
  26. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  27. <div id="titlearea">
  28. <table cellspacing="0" cellpadding="0">
  29. <tbody>
  30. <tr style="height: 56px;">
  31. <td id="projectalign" style="padding-left: 0.5em;">
  32. <div id="projectname">uTL
  33. </div>
  34. <div id="projectbrief">micro Template library</div>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. <!-- end header part -->
  41. <!-- Generated by Doxygen 1.8.14 -->
  42. <script type="text/javascript">
  43. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  44. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  45. /* @license-end */
  46. </script>
  47. <script type="text/javascript" src="menudata.js"></script>
  48. <script type="text/javascript" src="menu.js"></script>
  49. <script type="text/javascript">
  50. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  51. $(function() {
  52. initMenu('',true,false,'search.php','Search');
  53. $(document).ready(function() { init_search(); });
  54. });
  55. /* @license-end */</script>
  56. <div id="main-nav"></div>
  57. </div><!-- top -->
  58. <div id="side-nav" class="ui-resizable side-nav-resizable">
  59. <div id="nav-tree">
  60. <div id="nav-tree-contents">
  61. <div id="nav-sync" class="sync"></div>
  62. </div>
  63. </div>
  64. <div id="splitbar" style="-moz-user-select:none;"
  65. class="ui-resizable-handle">
  66. </div>
  67. </div>
  68. <script type="text/javascript">
  69. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  70. $(document).ready(function(){initNavTree('utility_2invoke_8h_source.html','');});
  71. /* @license-end */
  72. </script>
  73. <div id="doc-content">
  74. <!-- window showing the filter options -->
  75. <div id="MSearchSelectWindow"
  76. onmouseover="return searchBox.OnSearchSelectShow()"
  77. onmouseout="return searchBox.OnSearchSelectHide()"
  78. onkeydown="return searchBox.OnSearchSelectKey(event)">
  79. </div>
  80. <!-- iframe showing the search results (closed by default) -->
  81. <div id="MSearchResultsWindow">
  82. <iframe src="javascript:void(0)" frameborder="0"
  83. name="MSearchResults" id="MSearchResults">
  84. </iframe>
  85. </div>
  86. <div class="header">
  87. <div class="headertitle">
  88. <div class="title">invoke.h</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <a href="utility_2invoke_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;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef __utl_utility_invoke_h__</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define __utl_utility_invoke_h__</span></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;<span class="preprocessor">#include &lt;<a class="code" href="impl_8h.html">utl/core/impl.h</a>&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="meta_8h.html">utl/meta/meta.h</a>&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceutl.html">utl</a> {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">namespace </span>detail {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1is__ref__wrapper.html"> 40</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1detail_1_1is__ref__wrapper.html">is_ref_wrapper</a> : <a class="code" href="namespaceutl_1_1meta.html#a55511dbaa0adb605ce22dcec11f8d22d">meta::false_</a> {};</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class</span> U&gt;</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1is__ref__wrapper_3_01std_1_1reference__wrapper_3_01_u_01_4_01_4.html"> 42</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1detail_1_1is__ref__wrapper.html">is_ref_wrapper</a>&lt;<a class="code" href="namespacestd.html">std</a>::reference_wrapper&lt;U&gt;&gt; : <a class="code" href="namespaceutl_1_1meta.html#ae9a5a8fbe8202785f059935af219fb97">meta::true_</a> {};</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="comment">// 1</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keyword">class </span>Type, <span class="keyword">class </span>T1, <span class="keyword">class</span>... Args,</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <a class="code" href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">meta::enable_if_t</a>&lt;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; std::is_member_function_pointer&lt;std::decay_t&lt;Type T::*&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; std::is_base_of&lt;T, std::decay_t&lt;T1&gt;&gt;::value,</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keywordtype">int</span>&gt; =0</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; &gt;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1"> 51</a></span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(Type T::* f, T1&amp;&amp; t1, Args&amp;&amp;... args) {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">return</span> (std::forward&lt;T1&gt;(t1).*f)(std::forward&lt;Args&gt;(args)...);</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; }</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">// 2</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keyword">class </span>Type, <span class="keyword">class </span>T1, <span class="keyword">class</span>... Args,</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">meta::enable_if_t</a>&lt;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; std::is_member_function_pointer&lt;std::decay_t&lt;Type T::*&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; is_ref_wrapper&lt;std::decay_t&lt;T1&gt;&gt;::value,</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordtype">int</span>&gt; =0</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; &gt;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(Type T::* f, T1&amp;&amp; t1, Args&amp;&amp;... args) {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">return</span> (t1.get().*f)(std::forward&lt;Args&gt;(args)...);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; }</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="comment">// 3</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keyword">class </span>Type, <span class="keyword">class </span>T1, <span class="keyword">class</span>... Args,</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">meta::enable_if_t</a>&lt;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; std::is_member_function_pointer&lt;std::decay_t&lt;Type T::*&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; !std::is_base_of&lt;T, std::decay_t&lt;T1&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; !is_ref_wrapper&lt;std::decay_t&lt;T1&gt;&gt;::value,</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordtype">int</span>&gt; =0</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; &gt;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(Type T::* f, T1&amp;&amp; t1, Args&amp;&amp;... args) {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">return</span> ((*std::forward&lt;T1&gt;(t1)).*f)(std::forward&lt;Args&gt;(args)...);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; }</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="comment">// 4</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keyword">class </span>Type, <span class="keyword">class </span>T1, <span class="keyword">class</span>... Args,</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <a class="code" href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">meta::enable_if_t</a>&lt;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; std::is_member_object_pointer&lt;std::decay_t&lt;Type T::*&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; std::is_base_of&lt;T, std::decay_t&lt;T1&gt;&gt;::value,</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordtype">int</span>&gt; =0</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; &gt;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(Type T::* f, T1&amp;&amp; t1, Args&amp;&amp;... args) {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">return</span> std::forward&lt;T1&gt;(t1).*f;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// 5</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keyword">class </span>Type, <span class="keyword">class </span>T1, <span class="keyword">class</span>... Args,</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">meta::enable_if_t</a>&lt;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; std::is_member_object_pointer&lt;std::decay_t&lt;Type T::*&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; is_ref_wrapper&lt;std::decay_t&lt;T1&gt;&gt;::value,</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordtype">int</span>&gt; =0</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; &gt;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(Type T::* f, T1&amp;&amp; t1, Args&amp;&amp;... args) {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">return</span> t1.get().*f;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; }</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// 6</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>T, <span class="keyword">class </span>Type, <span class="keyword">class </span>T1, <span class="keyword">class</span>... Args,</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <a class="code" href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">meta::enable_if_t</a>&lt;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; std::is_member_object_pointer&lt;std::decay_t&lt;Type T::*&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; !std::is_base_of&lt;T, std::decay_t&lt;T1&gt;&gt;::value &amp;&amp;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; !is_ref_wrapper&lt;std::decay_t&lt;T1&gt;&gt;::value,</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="keywordtype">int</span>&gt; =0</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; &gt;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(Type T::* f, T1&amp;&amp; t1, Args&amp;&amp;... args) {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">return</span> (*std::forward&lt;T1&gt;(t1)).*f;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">class </span>F, <span class="keyword">class</span>... Args&gt;</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="namespaceutl_1_1detail.html#a09341831ecc9aab67a23d3a47b2d114f"> 113</a></span>&#160; decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">invoke_impl_</a>(F&amp;&amp; f, Args&amp;&amp;... args) {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">return</span> std::forward&lt;F&gt;(f)(std::forward&lt;Args&gt;(args)...);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; }</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; } <span class="comment">// namespace detail</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Callable, <span class="keyword">typename</span>... _Args&gt;</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="namespaceutl.html#adc675874b5426194d04112f76b356714"> 121</a></span>&#160; <span class="keyword">inline</span> decltype(<span class="keyword">auto</span>) <a class="code" href="namespaceutl.html#adc675874b5426194d04112f76b356714">invoke</a>(_Callable&amp;&amp; fn, _Args&amp;&amp;... args) {</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">return</span> <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">detail::invoke_impl_</a>(</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; std::forward&lt;_Callable&gt;(fn), std::forward&lt;_Args&gt;(args)...</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; );</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; }</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="structutl_1_1is__invocable.html"> 130</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1is__invocable.html">is_invocable</a> :</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; std::is_constructible&lt;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; std::function&lt;void(Args ...)&gt;,</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; std::reference_wrapper&lt;typename std::remove_reference&lt;F&gt;::type&gt;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; &gt; { };</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> R, <span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="structutl_1_1is__invocable__r.html"> 138</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1is__invocable__r.html">is_invocable_r</a> :</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; std::is_constructible&lt;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; std::function&lt;R(Args ...)&gt;,</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; std::reference_wrapper&lt;typename std::remove_reference&lt;F&gt;::type&gt;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; &gt; { };</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">namespace </span>detail {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Callable, <span class="keyword">typename</span>... _Args&gt;</div><div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1try__invoke.html"> 150</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1detail_1_1try__invoke.html">try_invoke</a> {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keyword">using</span> <a class="code" href="structutl_1_1detail_1_1try__invoke.html#a23491c600d42090f3eb400eadc49ef7f">type</a> = decltype (</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <a class="code" href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">detail::invoke_impl_</a>(std::declval&lt;_Callable&amp;&amp;&gt;(), std::declval&lt;_Args&amp;&amp;&gt;()...)</div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1try__invoke.html#a23491c600d42090f3eb400eadc49ef7f"> 153</a></span>&#160; );</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; };</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keyword">template</span>&lt;<span class="keywordtype">bool</span> B, <span class="keyword">typename</span> _Callable, <span class="keyword">typename</span>... _Args&gt;</div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1invoke__result__.html"> 157</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1detail_1_1invoke__result__.html">invoke_result_</a> {</div><div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1invoke__result__.html#a03e0ac5bf1e7751812af8828eb6550b3"> 158</a></span>&#160; <span class="keyword">using</span> <a class="code" href="structutl_1_1meta_1_1nil__.html">type</a> = <a class="code" href="structutl_1_1meta_1_1nil__.html">meta::nil_</a>;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; };</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> _Callable, <span class="keyword">typename</span>... _Args&gt;</div><div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1invoke__result___3_01true_00_01___callable_00_01___args_8_8_8_01_4.html"> 162</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1detail_1_1invoke__result__.html">invoke_result_</a> &lt;true, _Callable, _Args...&gt; {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keyword">using</span> <a class="code" href="structutl_1_1detail_1_1invoke__result___3_01true_00_01___callable_00_01___args_8_8_8_01_4.html#af68f2e0441486139aab41a8d5e74b35a">type</a> = <a class="code" href="namespaceutl_1_1meta.html#ac27f3e5f3ec42921d9f8a6bb85560cf1">meta::invoke_t</a>&lt;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="structutl_1_1meta_1_1quote.html">meta::quote&lt;try_invoke&gt;</a>, _Callable, _Args...</div><div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="structutl_1_1detail_1_1invoke__result___3_01true_00_01___callable_00_01___args_8_8_8_01_4.html#af68f2e0441486139aab41a8d5e74b35a"> 165</a></span>&#160; &gt;;</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; };</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; }</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> _Callable, <span class="keyword">typename</span>... _Args&gt;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keyword">using</span> <a class="code" href="structutl_1_1detail_1_1invoke__result__.html">invoke_result</a> = <a class="code" href="structutl_1_1detail_1_1invoke__result__.html">detail::invoke_result_</a>&lt;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="structutl_1_1is__invocable.html">is_invocable</a>&lt;_Callable, _Args...&gt;::value,</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; _Callable,</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; _Args...</div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="namespaceutl.html#a9dd560a1b217a10af34d1ade3e77a76b"> 174</a></span>&#160; &gt;;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Callable, <span class="keyword">typename</span>... _Args&gt;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keyword">using</span> <a class="code" href="namespaceutl.html#ae40494acc30f2894c74544f3e9142933">invoke_result_t</a> = <a class="code" href="namespaceutl_1_1meta.html#aa5a37adba244ff4286f994111c4c02ea">meta::eval</a> &lt;</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <a class="code" href="structutl_1_1detail_1_1invoke__result__.html">invoke_result</a>&lt;_Callable, _Args...&gt;</div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="namespaceutl.html#ae40494acc30f2894c74544f3e9142933"> 180</a></span>&#160; &gt;;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;}</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* __utl_utility_invoke_h__ */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceutl_1_1detail_html_a2c39a67272ada5da5f1b84115dadc4a1"><div class="ttname"><a href="namespaceutl_1_1detail.html#a2c39a67272ada5da5f1b84115dadc4a1">utl::detail::invoke_impl_</a></div><div class="ttdeci">decltype(auto) invoke_impl_(Type T::*f, T1 &amp;&amp;t1, Args &amp;&amp;... args)</div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00051">invoke.h:51</a></div></div>
  92. <div class="ttc" id="structutl_1_1detail_1_1invoke__result___html"><div class="ttname"><a href="structutl_1_1detail_1_1invoke__result__.html">utl::detail::invoke_result_</a></div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00157">invoke.h:157</a></div></div>
  93. <div class="ttc" id="meta_8h_html"><div class="ttname"><a href="meta_8h.html">meta.h</a></div><div class="ttdoc">Include all meta library. </div></div>
  94. <div class="ttc" id="namespaceutl_html_adc675874b5426194d04112f76b356714"><div class="ttname"><a href="namespaceutl.html#adc675874b5426194d04112f76b356714">utl::invoke</a></div><div class="ttdeci">decltype(auto) invoke(_Callable &amp;&amp;fn, _Args &amp;&amp;... args)</div><div class="ttdoc">Invoke a callable object (for C++14) </div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00121">invoke.h:121</a></div></div>
  95. <div class="ttc" id="structutl_1_1meta_1_1quote_html"><div class="ttname"><a href="structutl_1_1meta_1_1quote.html">utl::meta::quote</a></div><div class="ttdef"><b>Definition:</b> <a href="meta_2invoke_8h_source.html#l00234">invoke.h:234</a></div></div>
  96. <div class="ttc" id="namespaceutl_1_1meta_html_ae9a5a8fbe8202785f059935af219fb97"><div class="ttname"><a href="namespaceutl_1_1meta.html#ae9a5a8fbe8202785f059935af219fb97">utl::meta::true_</a></div><div class="ttdeci">bool_&lt; true &gt; true_</div><div class="ttdoc">The type used as a compile-time boolean with true value. </div><div class="ttdef"><b>Definition:</b> <a href="integral_8h_source.html#l00068">integral.h:68</a></div></div>
  97. <div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div><div class="ttdoc">STL namespace. </div></div>
  98. <div class="ttc" id="structutl_1_1detail_1_1invoke__result___3_01true_00_01___callable_00_01___args_8_8_8_01_4_html_af68f2e0441486139aab41a8d5e74b35a"><div class="ttname"><a href="structutl_1_1detail_1_1invoke__result___3_01true_00_01___callable_00_01___args_8_8_8_01_4.html#af68f2e0441486139aab41a8d5e74b35a">utl::detail::invoke_result_&lt; true, _Callable, _Args... &gt;::type</a></div><div class="ttdeci">meta::invoke_t&lt; meta::quote&lt; try_invoke &gt;, _Callable, _Args... &gt; type</div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00165">invoke.h:165</a></div></div>
  99. <div class="ttc" id="structutl_1_1meta_1_1nil___html"><div class="ttname"><a href="structutl_1_1meta_1_1nil__.html">utl::meta::nil_</a></div><div class="ttdef"><b>Definition:</b> <a href="integral_8h_source.html#l00043">integral.h:43</a></div></div>
  100. <div class="ttc" id="structutl_1_1detail_1_1is__ref__wrapper_html"><div class="ttname"><a href="structutl_1_1detail_1_1is__ref__wrapper.html">utl::detail::is_ref_wrapper</a></div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00040">invoke.h:40</a></div></div>
  101. <div class="ttc" id="namespaceutl_1_1meta_html_a55511dbaa0adb605ce22dcec11f8d22d"><div class="ttname"><a href="namespaceutl_1_1meta.html#a55511dbaa0adb605ce22dcec11f8d22d">utl::meta::false_</a></div><div class="ttdeci">bool_&lt; false &gt; false_</div><div class="ttdoc">The type used as a compile-time boolean with false value. </div><div class="ttdef"><b>Definition:</b> <a href="integral_8h_source.html#l00069">integral.h:69</a></div></div>
  102. <div class="ttc" id="structutl_1_1detail_1_1try__invoke_html"><div class="ttname"><a href="structutl_1_1detail_1_1try__invoke.html">utl::detail::try_invoke</a></div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00150">invoke.h:150</a></div></div>
  103. <div class="ttc" id="namespaceutl_1_1meta_html_aa5a37adba244ff4286f994111c4c02ea"><div class="ttname"><a href="namespaceutl_1_1meta.html#aa5a37adba244ff4286f994111c4c02ea">utl::meta::eval</a></div><div class="ttdeci">typename Tp::type eval</div><div class="ttdoc">Type alias for Tp::type. Used to evaluate/extract return type of metafunctions. </div><div class="ttdef"><b>Definition:</b> <a href="integral_8h_source.html#l00049">integral.h:49</a></div></div>
  104. <div class="ttc" id="namespaceutl_html"><div class="ttname"><a href="namespaceutl.html">utl</a></div><div class="ttdoc">STL&amp;#39;s core language concepts. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire_8h_source.html#l00030">_1wire.h:30</a></div></div>
  105. <div class="ttc" id="namespaceutl_1_1meta_html_a372fe391d9567f66a81091f581e1fa01"><div class="ttname"><a href="namespaceutl_1_1meta.html#a372fe391d9567f66a81091f581e1fa01">utl::meta::enable_if_t</a></div><div class="ttdeci">eval&lt; enable_if&lt; If, _Tp &gt; &gt; enable_if_t</div><div class="ttdoc">alias template for enable_if </div><div class="ttdef"><b>Definition:</b> <a href="sfinae_8h_source.html#l00063">sfinae.h:63</a></div></div>
  106. <div class="ttc" id="namespaceutl_html_ae40494acc30f2894c74544f3e9142933"><div class="ttname"><a href="namespaceutl.html#ae40494acc30f2894c74544f3e9142933">utl::invoke_result_t</a></div><div class="ttdeci">meta::eval&lt; invoke_result&lt; _Callable, _Args... &gt; &gt; invoke_result_t</div><div class="ttdoc">invoke_result_t (for C++14) </div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00180">invoke.h:180</a></div></div>
  107. <div class="ttc" id="structutl_1_1is__invocable__r_html"><div class="ttname"><a href="structutl_1_1is__invocable__r.html">utl::is_invocable_r</a></div><div class="ttdoc">std::is_invocable_r trait for C++11 </div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00138">invoke.h:138</a></div></div>
  108. <div class="ttc" id="structutl_1_1detail_1_1try__invoke_html_a23491c600d42090f3eb400eadc49ef7f"><div class="ttname"><a href="structutl_1_1detail_1_1try__invoke.html#a23491c600d42090f3eb400eadc49ef7f">utl::detail::try_invoke::type</a></div><div class="ttdeci">decltype(detail::invoke_impl_(std::declval&lt; _Callable &amp;&amp; &gt;(), std::declval&lt; _Args &amp;&amp; &gt;()...)) type</div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00153">invoke.h:153</a></div></div>
  109. <div class="ttc" id="namespaceutl_1_1meta_html_ac27f3e5f3ec42921d9f8a6bb85560cf1"><div class="ttname"><a href="namespaceutl_1_1meta.html#ac27f3e5f3ec42921d9f8a6bb85560cf1">utl::meta::invoke_t</a></div><div class="ttdeci">eval&lt; invoke&lt; Fn, Args... &gt; &gt; invoke_t</div><div class="ttdef"><b>Definition:</b> <a href="meta_2invoke_8h_source.html#l00088">invoke.h:88</a></div></div>
  110. <div class="ttc" id="impl_8h_html"><div class="ttname"><a href="impl_8h.html">impl.h</a></div><div class="ttdoc">Implementation detail main forward header. </div></div>
  111. <div class="ttc" id="structutl_1_1is__invocable_html"><div class="ttname"><a href="structutl_1_1is__invocable.html">utl::is_invocable</a></div><div class="ttdoc">std::is_invocable trait for C++11 </div><div class="ttdef"><b>Definition:</b> <a href="utility_2invoke_8h_source.html#l00130">invoke.h:130</a></div></div>
  112. </div><!-- fragment --></div><!-- contents -->
  113. </div><!-- doc-content -->
  114. <!-- start footer part -->
  115. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  116. <ul>
  117. <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_82754f54d9380477ef02477185c1f103.html">utl</a></li><li class="navelem"><a class="el" href="dir_cd2b5ca7f5fdf6a80655358f064ed410.html">utility</a></li><li class="navelem"><a class="el" href="utility_2invoke_8h.html">invoke.h</a></li>
  118. <li class="footer">Generated by
  119. <a href="http://www.doxygen.org/index.html">
  120. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  121. </ul>
  122. </div>
  123. </body>
  124. </html>