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">
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.9.1"/>
7 <title>libsigc++: hide(), hide_return()</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javascript" src="jquery.js"></script>
10 <script type="text/javascript" src="dynsections.js"></script>
11 <link href="doxygen.css" rel="stylesheet" type="text/css" />
12 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
17 <table cellspacing="0" cellpadding="0">
19 <tr style="height: 56px;">
20 <td style="padding-left: 0.5em;">
21 <div id="projectname">libsigc++
22  <span id="projectnumber">2.9.1</span>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.8.9.1 -->
31 <div id="navrow1" class="tabs">
33 <li><a href="index.html"><span>Main Page</span></a></li>
34 <li><a href="pages.html"><span>Related Pages</span></a></li>
35 <li><a href="modules.html"><span>Modules</span></a></li>
36 <li><a href="namespaces.html"><span>Namespaces</span></a></li>
37 <li><a href="annotated.html"><span>Classes</span></a></li>
43 <a href="#nested-classes">Classes</a> |
44 <a href="#func-members">Functions</a> </div>
45 <div class="headertitle">
46 <div class="title">hide(), hide_return()<div class="ingroups"><a class="el" href="group__adaptors.html">Adaptors</a></div></div> </div>
48 <div class="contents">
50 <p><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> alters an arbitrary functor in that it adds a parameter whose value is ignored on invocation of the returned functor.
51 <a href="#details">More...</a></p>
52 <table class="memberdecls">
53 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
54 Classes</h2></td></tr>
55 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor.html">sigc::hide_functor< I_location, T_functor ></a></td></tr>
56 <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that adds a dummy parameter to the wrapped functor. <a href="structsigc_1_1hide__functor.html#details">More...</a><br /></td></tr>
57 <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
58 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3_010_00_01T__functor_01_4.html">sigc::hide_functor< 0, T_functor ></a></td></tr>
59 <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that adds a dummy parameter to the wrapped functor. <a href="structsigc_1_1hide__functor_3_010_00_01T__functor_01_4.html#details">More...</a><br /></td></tr>
60 <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
61 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1hide__functor_3-1_00_01T__functor_01_4.html">sigc::hide_functor<-1, T_functor ></a></td></tr>
62 <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that adds a dummy parameter to the wrapped functor. <a href="structsigc_1_1hide__functor_3-1_00_01T__functor_01_4.html#details">More...</a><br /></td></tr>
63 <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
64 </table><table class="memberdecls">
65 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
66 Functions</h2></td></tr>
67 <tr class="memitem:gaf2cefea3a99acd44f68121424103172d"><td class="memTemplParams" colspan="2">template<int I_location, class T_functor > </td></tr>
68 <tr class="memitem:gaf2cefea3a99acd44f68121424103172d"><td class="memTemplItemLeft" align="right" valign="top">hide_functor< I_location, T_functor > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a> (const T_functor& _A_func)</td></tr>
69 <tr class="memdesc:gaf2cefea3a99acd44f68121424103172d"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. <a href="#gaf2cefea3a99acd44f68121424103172d">More...</a><br /></td></tr>
70 <tr class="separator:gaf2cefea3a99acd44f68121424103172d"><td class="memSeparator" colspan="2"> </td></tr>
71 <tr class="memitem:gacbbacd3553268d85b95e3a85aefb67e5"><td class="memTemplParams" colspan="2">template<class T_functor > </td></tr>
72 <tr class="memitem:gacbbacd3553268d85b95e3a85aefb67e5"><td class="memTemplItemLeft" align="right" valign="top">hide_functor<-1, T_functor > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gacbbacd3553268d85b95e3a85aefb67e5">sigc::hide</a> (const T_functor& _A_func)</td></tr>
73 <tr class="memdesc:gacbbacd3553268d85b95e3a85aefb67e5"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. <a href="#gacbbacd3553268d85b95e3a85aefb67e5">More...</a><br /></td></tr>
74 <tr class="separator:gacbbacd3553268d85b95e3a85aefb67e5"><td class="memSeparator" colspan="2"> </td></tr>
75 <tr class="memitem:gae4e6f5491471c12440f1c5d480726b98"><td class="memTemplParams" colspan="2">template<class T_functor > </td></tr>
76 <tr class="memitem:gae4e6f5491471c12440f1c5d480726b98"><td class="memTemplItemLeft" align="right" valign="top">retype_return_functor< void, T_functor > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__hide.html#gae4e6f5491471c12440f1c5d480726b98">sigc::hide_return</a> (const T_functor& _A_functor)</td></tr>
77 <tr class="memdesc:gae4e6f5491471c12440f1c5d480726b98"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1retype__return__functor.html" title="Adaptor that performs a C-style cast on the return value of a functor. ">sigc::retype_return_functor</a> which drops the return value of the passed functor. <a href="#gae4e6f5491471c12440f1c5d480726b98">More...</a><br /></td></tr>
78 <tr class="separator:gae4e6f5491471c12440f1c5d480726b98"><td class="memSeparator" colspan="2"> </td></tr>
80 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
81 <p><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> alters an arbitrary functor in that it adds a parameter whose value is ignored on invocation of the returned functor. </p>
82 <p>Thus you can discard one argument of a signal.</p>
83 <p>You may optionally specify the zero-based position of the parameter to ignore as a template argument. The default is to ignore the last parameter. (A value of <code>-1</code> adds a parameter at the end so <a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide</a><-1>() gives the same result as <a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a>.)</p>
84 <p>The type of the parameter can optionally be specified if not deduced.</p>
85 <dl class="section user"><dt>Examples:</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> foo(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>);</div>
86 <div class="line"><span class="comment">// single argument hiding ...</span></div>
87 <div class="line"><a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(&foo)(1,2,3); <span class="comment">// adds a dummy parameter at the back and calls foo(1,2)</span></div>
88 <div class="line"><a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a><-1>(&foo)(1,2,3); <span class="comment">// same as sigc::hide(&foo)(1,2,3) (calls foo(1,2))</span></div>
89 <div class="line">sigc::hide<0>(&foo)(1,2,3); <span class="comment">// adds a dummy parameter at the beginning and calls foo(2,3)</span></div>
90 <div class="line">sigc::hide<1>(&foo)(1,2,3); <span class="comment">// adds a dummy parameter in the middle and calls foo(1,3)</span></div>
91 <div class="line">sigc::hide<2>(&foo)(1,2,3); <span class="comment">// adds a dummy parameter at the back and calls foo(1,2)</span></div>
92 </div><!-- fragment --></dd></dl>
93 <p>The functor <a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> returns can be directly passed into <a class="el" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2" title="Add a slot to the list of slots. ">sigc::signal::connect()</a>.</p>
94 <dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><a class="code" href="classsigc_1_1signal.html">sigc::signal<void,int></a> some_signal;</div>
95 <div class="line"><span class="keywordtype">void</span> foo();</div>
96 <div class="line">some_signal.<a class="code" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2">connect</a>(<a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(&foo));</div>
97 </div><!-- fragment --></dd></dl>
98 <p><a class="el" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d" title="Creates an adaptor of type sigc::hide_functor which adds a dummy parameter to the passed functor...">sigc::hide()</a> can be nested in order to discard multiple arguments. </p><dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="comment">// multiple argument hiding ...</span></div>
99 <div class="line"><a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(<a class="code" href="group__hide.html#gaf2cefea3a99acd44f68121424103172d">sigc::hide</a>(&foo))(1,2,3,4); <span class="comment">// adds two dummy parameters at the back and calls foo(1,2)</span></div>
100 </div><!-- fragment --></dd></dl>
101 <p><a class="el" href="group__hide.html#gae4e6f5491471c12440f1c5d480726b98" title="Creates an adaptor of type sigc::retype_return_functor which drops the return value of the passed fun...">sigc::hide_return()</a> alters an arbitrary functor by dropping its return value, thus converting it to a void functor. </p>
102 <h2 class="groupheader">Function Documentation</h2>
103 <a class="anchor" id="gaf2cefea3a99acd44f68121424103172d"></a>
104 <div class="memitem">
105 <div class="memproto">
106 <div class="memtemplate">
107 template <int I_location, class T_functor > </div>
108 <table class="mlabels">
110 <td class="mlabels-left">
111 <table class="memname">
113 <td class="memname">hide_functor<I_location, T_functor> sigc::hide </td>
115 <td class="paramtype">const T_functor & </td>
116 <td class="paramname"><em>_A_func</em></td><td>)</td>
121 <td class="mlabels-right">
122 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
125 </div><div class="memdoc">
127 <p>Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. </p>
128 <p>The optional template argument <em>I_location</em> specifies the zero-based position of the dummy parameter in the returned functor (<code>-1</code> stands for the last parameter).</p>
129 <dl class="params"><dt>Parameters</dt><dd>
130 <table class="params">
131 <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr>
135 <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_func</em>, ignoring the value of the dummy parameter. </dd></dl>
139 <a class="anchor" id="gacbbacd3553268d85b95e3a85aefb67e5"></a>
140 <div class="memitem">
141 <div class="memproto">
142 <div class="memtemplate">
143 template <class T_functor > </div>
144 <table class="mlabels">
146 <td class="mlabels-left">
147 <table class="memname">
149 <td class="memname">hide_functor<-1, T_functor> sigc::hide </td>
151 <td class="paramtype">const T_functor & </td>
152 <td class="paramname"><em>_A_func</em></td><td>)</td>
157 <td class="mlabels-right">
158 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
161 </div><div class="memdoc">
163 <p>Creates an adaptor of type <a class="el" href="structsigc_1_1hide__functor.html" title="Adaptor that adds a dummy parameter to the wrapped functor. ">sigc::hide_functor</a> which adds a dummy parameter to the passed functor. </p>
164 <p>This overload adds a dummy parameter at the back of the functor's parameter list.</p>
165 <dl class="params"><dt>Parameters</dt><dd>
166 <table class="params">
167 <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr>
171 <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_func</em>, ignoring the value of the last parameter. </dd></dl>
175 <a class="anchor" id="gae4e6f5491471c12440f1c5d480726b98"></a>
176 <div class="memitem">
177 <div class="memproto">
178 <div class="memtemplate">
179 template <class T_functor > </div>
180 <table class="mlabels">
182 <td class="mlabels-left">
183 <table class="memname">
185 <td class="memname">retype_return_functor<void, T_functor> sigc::hide_return </td>
187 <td class="paramtype">const T_functor & </td>
188 <td class="paramname"><em>_A_functor</em></td><td>)</td>
193 <td class="mlabels-right">
194 <span class="mlabels"><span class="mlabel">inline</span></span> </td>
197 </div><div class="memdoc">
199 <p>Creates an adaptor of type <a class="el" href="structsigc_1_1retype__return__functor.html" title="Adaptor that performs a C-style cast on the return value of a functor. ">sigc::retype_return_functor</a> which drops the return value of the passed functor. </p>
200 <dl class="params"><dt>Parameters</dt><dd>
201 <table class="params">
202 <tr><td class="paramname">_A_functor</td><td>Functor that should be wrapped. </td></tr>
206 <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_functor</em> dropping its return value. </dd></dl>
210 </div><!-- contents -->
211 <!-- start footer part -->
212 <hr class="footer"/><address class="footer"><small>
213 Generated on Wed Mar 16 2016 13:54:32 for libsigc++ by  <a href="http://www.doxygen.org/index.html">
214 <img class="footer" src="doxygen.png" alt="doxygen"/>