<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2Fbind</id>
		<title>CPP/bind - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2Fbind"/>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=CPP/bind&amp;action=history"/>
		<updated>2026-06-07T04:21:11Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://programmingexamples.net/w/index.php?title=CPP/bind&amp;diff=5228&amp;oldid=prev</id>
		<title>Daviddoria: Created page with &quot;==bind.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &lt;iostream&gt; #include &lt;functional&gt;  void add(int a, int b) {     std::cout &lt;&lt; &quot;a: &quot; &lt;&lt; a &lt;&lt; &quot; b: &quot; &lt;&lt; b &lt;&lt; std::endl; }  int main(int,c...&quot;</title>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=CPP/bind&amp;diff=5228&amp;oldid=prev"/>
				<updated>2016-11-19T13:49:55Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==bind.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;iostream&amp;gt; #include &amp;lt;functional&amp;gt;  void add(int a, int b) {     std::cout &amp;lt;&amp;lt; &amp;quot;a: &amp;quot; &amp;lt;&amp;lt; a &amp;lt;&amp;lt; &amp;quot; b: &amp;quot; &amp;lt;&amp;lt; b &amp;lt;&amp;lt; std::endl; }  int main(int,c...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==bind.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;functional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void add(int a, int b)&lt;br /&gt;
{&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;a: &amp;quot; &amp;lt;&amp;lt; a &amp;lt;&amp;lt; &amp;quot; b: &amp;quot; &amp;lt;&amp;lt; b &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int,char*[])&lt;br /&gt;
{&lt;br /&gt;
    // free function, full call&lt;br /&gt;
    {&lt;br /&gt;
    std::function&amp;lt;void(int, int)&amp;gt; f = std::bind(add, std::placeholders::_1, std::placeholders::_2);&lt;br /&gt;
    f(1,2);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // free function, partial-arg call&lt;br /&gt;
    {&lt;br /&gt;
    std::function&amp;lt;void(int)&amp;gt; f = std::bind(add, 1, std::placeholders::_1);&lt;br /&gt;
    f(2);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // free function, no-arg call&lt;br /&gt;
    {&lt;br /&gt;
    std::function&amp;lt;void()&amp;gt; f = std::bind(add, 1, 2);&lt;br /&gt;
    f();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CMakeLists.txt==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
 &lt;br /&gt;
Project(bind)&lt;br /&gt;
 &lt;br /&gt;
SET(CMAKE_CXX_FLAGS &amp;quot;${CMAKE_CXX_FLAGS} -Wall -std=c++11&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
ADD_EXECUTABLE(bind bind.cpp)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>