<!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.7"/> <title>libsigc++: bind(), bind_return()</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="doxygen.css" rel="stylesheet" type="text/css" /> <link href="doxygen-extra.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 style="padding-left: 0.5em;"> <div id="projectname">libsigc++  <span id="projectnumber">2.4.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.7 --> <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="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">bind(), bind_return()<div class="ingroups"><a class="el" href="group__adaptors.html">Adaptors</a></div></div> </div> </div><!--header--> <div class="contents"> <p><a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind()</a> alters an arbitrary functor by fixing arguments to certain values. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1bind__functor.html">sigc::bind_functor< I_location, T_functor, T_type1, T_type2, T_type3, T_type4, T_type5, T_type6, T_type7 ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that binds an argument to the wrapped functor. <a href="structsigc_1_1bind__functor.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1bind__functor_3_010_00_01T__functor_00_01T__bound_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_01_4.html">sigc::bind_functor< 0, T_functor, T_bound, nil, nil, nil, nil, nil, nil ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that binds an argument to the wrapped functor. <a href="structsigc_1_1bind__functor_3_010_00_01T__functor_00_01T__bound_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_01_4.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1bind__functor_3-1_00_01T__functor_00_01T__type1_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_01_4.html">sigc::bind_functor<-1, T_functor, T_type1, nil, nil, nil, nil, nil, nil ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that binds 1 argument(s) to the wrapped functor. <a href="structsigc_1_1bind__functor_3-1_00_01T__functor_00_01T__type1_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_00_01nil_01_4.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structsigc_1_1bind__return__functor.html">sigc::bind_return_functor< T_return, T_functor ></a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Adaptor that fixes the return value of the wrapped functor. <a href="structsigc_1_1bind__return__functor.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga2f099bc6056b32f2a58134ba8537c6f4"><td class="memTemplParams" colspan="2">template<int I_location, class T_bound1 , class T_functor > </td></tr> <tr class="memitem:ga2f099bc6056b32f2a58134ba8537c6f4"><td class="memTemplItemLeft" align="right" valign="top">bind_functor< I_location, <br class="typebreak" /> T_functor, T_bound1 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a> (const T_functor& _A_func, T_bound1 _A_b1)</td></tr> <tr class="memdesc:ga2f099bc6056b32f2a58134ba8537c6f4"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which binds the passed argument to the passed functor. <a href="#ga2f099bc6056b32f2a58134ba8537c6f4">More...</a><br /></td></tr> <tr class="separator:ga2f099bc6056b32f2a58134ba8537c6f4"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga211b3361bb1ae7484b2b276fd926b962"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_functor > </td></tr> <tr class="memitem:ga211b3361bb1ae7484b2b276fd926b962"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#ga211b3361bb1ae7484b2b276fd926b962">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1)</td></tr> <tr class="memdesc:ga211b3361bb1ae7484b2b276fd926b962"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 1 argument(s) of the passed functor. <a href="#ga211b3361bb1ae7484b2b276fd926b962">More...</a><br /></td></tr> <tr class="separator:ga211b3361bb1ae7484b2b276fd926b962"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gaf1e076f0734addb8080f1cbcac602591"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_type2 , class T_functor > </td></tr> <tr class="memitem:gaf1e076f0734addb8080f1cbcac602591"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1, T_type2 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#gaf1e076f0734addb8080f1cbcac602591">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1, T_type2 _A_b2)</td></tr> <tr class="memdesc:gaf1e076f0734addb8080f1cbcac602591"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 2 argument(s) of the passed functor. <a href="#gaf1e076f0734addb8080f1cbcac602591">More...</a><br /></td></tr> <tr class="separator:gaf1e076f0734addb8080f1cbcac602591"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga047061c9fa7d9dcde68c27cceed476a1"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_type2 , class T_type3 , class T_functor > </td></tr> <tr class="memitem:ga047061c9fa7d9dcde68c27cceed476a1"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1, T_type2, T_type3 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#ga047061c9fa7d9dcde68c27cceed476a1">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1, T_type2 _A_b2, T_type3 _A_b3)</td></tr> <tr class="memdesc:ga047061c9fa7d9dcde68c27cceed476a1"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 3 argument(s) of the passed functor. <a href="#ga047061c9fa7d9dcde68c27cceed476a1">More...</a><br /></td></tr> <tr class="separator:ga047061c9fa7d9dcde68c27cceed476a1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga8366abceb86ee653ec2ac50cef9fd16d"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_functor > </td></tr> <tr class="memitem:ga8366abceb86ee653ec2ac50cef9fd16d"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1, T_type2, T_type3, <br class="typebreak" /> T_type4 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#ga8366abceb86ee653ec2ac50cef9fd16d">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1, T_type2 _A_b2, T_type3 _A_b3, T_type4 _A_b4)</td></tr> <tr class="memdesc:ga8366abceb86ee653ec2ac50cef9fd16d"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 4 argument(s) of the passed functor. <a href="#ga8366abceb86ee653ec2ac50cef9fd16d">More...</a><br /></td></tr> <tr class="separator:ga8366abceb86ee653ec2ac50cef9fd16d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga7f163c830d7906906cf21ff0c5e0f17f"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_type5 , class T_functor > </td></tr> <tr class="memitem:ga7f163c830d7906906cf21ff0c5e0f17f"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1, T_type2, T_type3, <br class="typebreak" /> T_type4, T_type5 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#ga7f163c830d7906906cf21ff0c5e0f17f">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1, T_type2 _A_b2, T_type3 _A_b3, T_type4 _A_b4, T_type5 _A_b5)</td></tr> <tr class="memdesc:ga7f163c830d7906906cf21ff0c5e0f17f"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 5 argument(s) of the passed functor. <a href="#ga7f163c830d7906906cf21ff0c5e0f17f">More...</a><br /></td></tr> <tr class="separator:ga7f163c830d7906906cf21ff0c5e0f17f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gac370f58b773f68c229c181f07e9b9e79"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_type5 , class T_type6 , class T_functor > </td></tr> <tr class="memitem:gac370f58b773f68c229c181f07e9b9e79"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1, T_type2, T_type3, <br class="typebreak" /> T_type4, T_type5, T_type6 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#gac370f58b773f68c229c181f07e9b9e79">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1, T_type2 _A_b2, T_type3 _A_b3, T_type4 _A_b4, T_type5 _A_b5, T_type6 _A_b6)</td></tr> <tr class="memdesc:gac370f58b773f68c229c181f07e9b9e79"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 6 argument(s) of the passed functor. <a href="#gac370f58b773f68c229c181f07e9b9e79">More...</a><br /></td></tr> <tr class="separator:gac370f58b773f68c229c181f07e9b9e79"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga962b581ef0c17562bb3317783d3ffe7d"><td class="memTemplParams" colspan="2">template<class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_type5 , class T_type6 , class T_type7 , class T_functor > </td></tr> <tr class="memitem:ga962b581ef0c17562bb3317783d3ffe7d"><td class="memTemplItemLeft" align="right" valign="top">bind_functor<-1, T_functor, <br class="typebreak" /> T_type1, T_type2, T_type3, <br class="typebreak" /> T_type4, T_type5, T_type6, <br class="typebreak" /> T_type7 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#ga962b581ef0c17562bb3317783d3ffe7d">sigc::bind</a> (const T_functor& _A_func, T_type1 _A_b1, T_type2 _A_b2, T_type3 _A_b3, T_type4 _A_b4, T_type5 _A_b5, T_type6 _A_b6, T_type7 _A_b7)</td></tr> <tr class="memdesc:ga962b581ef0c17562bb3317783d3ffe7d"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 7 argument(s) of the passed functor. <a href="#ga962b581ef0c17562bb3317783d3ffe7d">More...</a><br /></td></tr> <tr class="separator:ga962b581ef0c17562bb3317783d3ffe7d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gaca1ae2466988d67d00a5f2cd16c8d90a"><td class="memTemplParams" colspan="2">template<class T_return , class T_functor > </td></tr> <tr class="memitem:gaca1ae2466988d67d00a5f2cd16c8d90a"><td class="memTemplItemLeft" align="right" valign="top">bind_return_functor< T_return, <br class="typebreak" /> T_functor > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__bind.html#gaca1ae2466988d67d00a5f2cd16c8d90a">sigc::bind_return</a> (const T_functor& _A_functor, T_return _A_ret_value)</td></tr> <tr class="memdesc:gaca1ae2466988d67d00a5f2cd16c8d90a"><td class="mdescLeft"> </td><td class="mdescRight">Creates an adaptor of type <a class="el" href="structsigc_1_1bind__return__functor.html" title="Adaptor that fixes the return value of the wrapped functor. ">sigc::bind_return_functor</a> which fixes the return value of the passed functor to the passed argument. <a href="#gaca1ae2466988d67d00a5f2cd16c8d90a">More...</a><br /></td></tr> <tr class="separator:gaca1ae2466988d67d00a5f2cd16c8d90a"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <p><a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind()</a> alters an arbitrary functor by fixing arguments to certain values. </p> <p>Up to 7 arguments can be bound at a time. For single argument binding, overloads of <a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind()</a> are provided that let you specify the zero-based position of the argument to fix with the first template parameter. (A value of <code>-1</code> fixes the last argument so <a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind</a><-1>() gives the same result as <a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind()</a>.) The types of the arguments can optionally be specified if not deduced.</p> <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>, <span class="keywordtype">int</span>);</div> <div class="line"><span class="comment">// single argument binding ...</span></div> <div class="line"><a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a>(&foo,1)(2,3); <span class="comment">//fixes the last (third) argument and calls foo(2,3,1)</span></div> <div class="line"><a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a><-1>(&foo,1)(2,3); <span class="comment">//same as bind(&foo,1)(2,3) (calls foo(2,3,1))</span></div> <div class="line">sigc::bind<0>(&foo,1)(2,3); <span class="comment">//fixes the first argument and calls foo(1,2,3)</span></div> <div class="line">sigc::bind<1>(&foo,1)(2,3); <span class="comment">//fixes the second argument and calls foo(2,1,3)</span></div> <div class="line">sigc::bind<2>(&foo,1)(2,3); <span class="comment">//fixes the third argument and calls foo(2,3,1)</span></div> <div class="line"><span class="comment">// multi argument binding ...</span></div> <div class="line"><a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a>(&foo,1,2)(3); <span class="comment">//fixes the last two arguments and calls foo(3,1,2)</span></div> <div class="line"><a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a>(&foo,1,2,3)(); <span class="comment">//fixes all three arguments and calls foo(1,2,3)</span></div> </div><!-- fragment --></dd></dl> <p>The functor <a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind()</a> returns can be passed into <a class="el" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2" title="Add a slot to the list of slots. ">sigc::signal::connect()</a> directly.</p> <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></a> some_signal;</div> <div class="line"><span class="keywordtype">void</span> foo(<span class="keywordtype">int</span>);</div> <div class="line">some_signal.<a class="code" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2">connect</a>(<a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a>(&foo,1));</div> </div><!-- fragment --></dd></dl> <p><a class="el" href="group__bind.html#gaca1ae2466988d67d00a5f2cd16c8d90a" title="Creates an adaptor of type sigc::bind_return_functor which fixes the return value of the passed funct...">sigc::bind_return()</a> alters an arbitrary functor by fixing its return value to a certain value.</p> <dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> foo();</div> <div class="line">std::cout << <a class="code" href="group__bind.html#gaca1ae2466988d67d00a5f2cd16c8d90a">sigc::bind_return</a>(&foo, 5)(); <span class="comment">// calls foo() and returns 5</span></div> </div><!-- fragment --></dd></dl> <p>You can bind references to functors by passing the objects through the <a class="el" href="namespacesigc.html#a48e982c74c057b5630246ba436524041" title="Creates a reference wrapper. ">sigc::ref()</a> helper function.</p> <dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">int</span> some_int;</div> <div class="line"><a class="code" href="classsigc_1_1signal.html">sigc::signal<void></a> some_signal;</div> <div class="line"><span class="keywordtype">void</span> foo(<span class="keywordtype">int</span>&);</div> <div class="line">some_signal.<a class="code" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2">connect</a>(<a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a>(&foo,<a class="code" href="namespacesigc.html#a48e982c74c057b5630246ba436524041">sigc::ref</a>(some_int)));</div> </div><!-- fragment --></dd></dl> <p>If you bind an object of a <a class="el" href="structsigc_1_1trackable.html" title="Base class for objects with auto-disconnection. ">sigc::trackable</a> derived type to a functor by reference, a slot assigned to the bind adaptor is cleared automatically when the object goes out of scope.</p> <dl class="section user"><dt>Example:</dt><dd><div class="fragment"><div class="line"><span class="keyword">struct </span>bar : <span class="keyword">public</span> <a class="code" href="structsigc_1_1trackable.html">sigc::trackable</a> {} some_bar;</div> <div class="line"><a class="code" href="classsigc_1_1signal.html">sigc::signal<void></a> some_signal;</div> <div class="line"><span class="keywordtype">void</span> foo(bar&);</div> <div class="line">some_signal.<a class="code" href="classsigc_1_1signal7.html#adc55ac9b0f935fd87a67904022e03cb2">connect</a>(<a class="code" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4">sigc::bind</a>(&foo,<a class="code" href="namespacesigc.html#a48e982c74c057b5630246ba436524041">sigc::ref</a>(some_bar)));</div> <div class="line"> <span class="comment">// disconnected automatically if some_bar goes out of scope</span></div> </div><!-- fragment --></dd></dl> <p>For a more powerful version of this functionality see the lambda library adaptor <a class="el" href="group__lambdas.html#ga56a5905d189af5fab33d8c456f097a29" title="Alters an arbitrary functor by rebuilding its arguments from 1 lambda expressions. ">sigc::group()</a> which can bind, hide and reorder arguments arbitrarily. Although <a class="el" href="group__lambdas.html#ga56a5905d189af5fab33d8c456f097a29" title="Alters an arbitrary functor by rebuilding its arguments from 1 lambda expressions. ">sigc::group()</a> is more flexible, <a class="el" href="group__bind.html#ga2f099bc6056b32f2a58134ba8537c6f4" title="Creates an adaptor of type sigc::bind_functor which binds the passed argument to the passed functor...">sigc::bind()</a> provides a means of binding parameters when the total number of parameters called is variable. </p> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga2f099bc6056b32f2a58134ba8537c6f4"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <int I_location, class T_bound1 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<I_location, T_functor, T_bound1> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_bound1 </td> <td class="paramname"><em>_A_b1</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which binds the passed argument to the passed functor. </p> <p>The optional template argument <em>I_location</em> specifies the zero-based position of the argument to be fixed (<code>-1</code> stands for the last argument).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_func</em> with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="ga211b3361bb1ae7484b2b276fd926b962"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 1 argument(s) of the passed functor. </p> <p>This function overload fixes the last 1 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="gaf1e076f0734addb8080f1cbcac602591"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_type2 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1, T_type2> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type2 </td> <td class="paramname"><em>_A_b2</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 2 argument(s) of the passed functor. </p> <p>This function overload fixes the last 2 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b2</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="ga047061c9fa7d9dcde68c27cceed476a1"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_type2 , class T_type3 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1, T_type2, T_type3> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type2 </td> <td class="paramname"><em>_A_b2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type3 </td> <td class="paramname"><em>_A_b3</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 3 argument(s) of the passed functor. </p> <p>This function overload fixes the last 3 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b2</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b3</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="ga8366abceb86ee653ec2ac50cef9fd16d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1, T_type2, T_type3, T_type4> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type2 </td> <td class="paramname"><em>_A_b2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type3 </td> <td class="paramname"><em>_A_b3</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type4 </td> <td class="paramname"><em>_A_b4</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 4 argument(s) of the passed functor. </p> <p>This function overload fixes the last 4 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b2</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b3</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b4</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="ga7f163c830d7906906cf21ff0c5e0f17f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_type5 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1, T_type2, T_type3, T_type4, T_type5> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type2 </td> <td class="paramname"><em>_A_b2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type3 </td> <td class="paramname"><em>_A_b3</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type4 </td> <td class="paramname"><em>_A_b4</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type5 </td> <td class="paramname"><em>_A_b5</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 5 argument(s) of the passed functor. </p> <p>This function overload fixes the last 5 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b2</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b3</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b4</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b5</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="gac370f58b773f68c229c181f07e9b9e79"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_type5 , class T_type6 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1, T_type2, T_type3, T_type4, T_type5, T_type6> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type2 </td> <td class="paramname"><em>_A_b2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type3 </td> <td class="paramname"><em>_A_b3</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type4 </td> <td class="paramname"><em>_A_b4</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type5 </td> <td class="paramname"><em>_A_b5</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type6 </td> <td class="paramname"><em>_A_b6</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 6 argument(s) of the passed functor. </p> <p>This function overload fixes the last 6 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b2</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b3</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b4</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b5</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b6</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="ga962b581ef0c17562bb3317783d3ffe7d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_type1 , class T_type2 , class T_type3 , class T_type4 , class T_type5 , class T_type6 , class T_type7 , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_functor<-1, T_functor, T_type1, T_type2, T_type3, T_type4, T_type5, T_type6, T_type7> sigc::bind </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_func</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type1 </td> <td class="paramname"><em>_A_b1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type2 </td> <td class="paramname"><em>_A_b2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type3 </td> <td class="paramname"><em>_A_b3</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type4 </td> <td class="paramname"><em>_A_b4</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type5 </td> <td class="paramname"><em>_A_b5</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type6 </td> <td class="paramname"><em>_A_b6</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_type7 </td> <td class="paramname"><em>_A_b7</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__functor.html" title="Adaptor that binds an argument to the wrapped functor. ">sigc::bind_functor</a> which fixes the last 7 argument(s) of the passed functor. </p> <p>This function overload fixes the last 7 argument(s) of <em>_A_func</em>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_func</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_b1</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b2</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b3</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b4</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b5</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b6</td><td>Argument to bind to <em>_A_func</em>. </td></tr> <tr><td class="paramname">_A_b7</td><td>Argument to bind to <em>_A_func</em>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes _A_func with the bound argument on invokation. </dd></dl> </div> </div> <a class="anchor" id="gaca1ae2466988d67d00a5f2cd16c8d90a"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template <class T_return , class T_functor > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bind_return_functor<T_return, T_functor> sigc::bind_return </td> <td>(</td> <td class="paramtype">const T_functor & </td> <td class="paramname"><em>_A_functor</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">T_return </td> <td class="paramname"><em>_A_ret_value</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an adaptor of type <a class="el" href="structsigc_1_1bind__return__functor.html" title="Adaptor that fixes the return value of the wrapped functor. ">sigc::bind_return_functor</a> which fixes the return value of the passed functor to the passed argument. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">_A_functor</td><td>Functor that should be wrapped. </td></tr> <tr><td class="paramname">_A_ret_value</td><td>Argument to fix the return value of <em>_A_functor</em> to. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>Adaptor that executes <em>_A_functor</em> on invokation and returns <em>_A_ret_value</em>. </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Mon Sep 15 2014 15:59:58 for libsigc++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.7 </small></address> </body> </html>