1
0
forked from boostorg/bind

Made the Boost logo link to the home page

[SVN r31114]
This commit is contained in:
Peter Dimov
2005-09-25 22:03:37 +00:00
parent 0c96dbe3f1
commit b85adc3a58
2 changed files with 237 additions and 241 deletions

View File

@@ -7,7 +7,7 @@
<body style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%" bgColor="white"> <body style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%" bgColor="white">
<table width="100%" border="0"> <table width="100%" border="0">
<tr> <tr>
<td width="277"><IMG height="86" alt="boost.png (6897 bytes)" src="../../boost.png" width="277"> <td width="277"><A href="../../index.htm"><IMG height="86" alt="boost.png (6897 bytes)" src="../../boost.png" width="277" border="0"></A>
</td> </td>
<td align="center"> <td align="center">
<h1>bind.hpp</h1> <h1>bind.hpp</h1>
@@ -284,8 +284,8 @@ std::for_each(v.begin(), v.end(), bind(apply&lt;void&gt;(), _1, 5));
protect</STRONG>. To protect a <STRONG>bind</STRONG> function object from protect</STRONG>. To protect a <STRONG>bind</STRONG> function object from
evaluation, use <tt>protect(bind(f, ...))</tt>.</P> evaluation, use <tt>protect(bind(f, ...))</tt>.</P>
<h3><a name="operators">Overloaded operators</a> (new in Boost 1.33)</h3> <h3><a name="operators">Overloaded operators</a> (new in Boost 1.33)</h3>
<p>For convenience, the function objects produced by <tt>bind</tt> overload <p>For convenience, the function objects produced by <tt>bind</tt> overload the
the logical not operator <STRONG>!</STRONG> and the relational operators <STRONG>==</STRONG>, logical not operator <STRONG>!</STRONG> and the relational operators <STRONG>==</STRONG>,
<STRONG>!=</STRONG>, <STRONG>&lt;</STRONG>, <STRONG>&lt;=</STRONG>, <STRONG>&gt;</STRONG>, <STRONG>!=</STRONG>, <STRONG>&lt;</STRONG>, <STRONG>&lt;=</STRONG>, <STRONG>&gt;</STRONG>,
<STRONG>&gt;=</STRONG>.</p> <STRONG>&gt;=</STRONG>.</p>
<P><tt>!bind(f, ...)</tt> is equivalent to <tt>bind( <EM>logical_not</EM>(), bind(f, <P><tt>!bind(f, ...)</tt> is equivalent to <tt>bind( <EM>logical_not</EM>(), bind(f,
@@ -295,8 +295,7 @@ std::for_each(v.begin(), v.end(), bind(apply&lt;void&gt;(), _1, 5));
is equivalent to <tt>bind( <EM>relation</EM>(), bind(f, ...), x )</tt>, where <em>relation</em> is equivalent to <tt>bind( <EM>relation</EM>(), bind(f, ...), x )</tt>, where <em>relation</em>
is a function object that takes two arguments <tt>a</tt> and <tt>b</tt> and is a function object that takes two arguments <tt>a</tt> and <tt>b</tt> and
returns <tt>a <EM>op</EM> b</tt>.</P> returns <tt>a <EM>op</EM> b</tt>.</P>
<P>What this means in practice is that you can conveniently negate the result of <P>What this means in practice is that you can conveniently negate the result of <tt>bind</tt>:</P>
<tt>bind</tt>:</P>
<P><tt>std::remove_if( first, last, !bind( &amp;X::visible, _1 ) ); // remove invisible <P><tt>std::remove_if( first, last, !bind( &amp;X::visible, _1 ) ); // remove invisible
objects</tt></P> objects</tt></P>
<P>and compare the result of <tt>bind</tt> against a value:</P> <P>and compare the result of <tt>bind</tt> against a value:</P>
@@ -863,8 +862,8 @@ namespace
(now part of Boost) by Jaakko J<>rvi and Gary Powell (the successor to the (now part of Boost) by Jaakko J<>rvi and Gary Powell (the successor to the
Binder Library); Binder Library);
<li> <li>
<a href="http://more.sourceforge.net/">Extensions to the <a href="http://more.sourceforge.net/">Extensions to the STL</a> by Petter
STL</a> by Petter Urkedal.</li></ul> Urkedal.</li></ul>
<p>Doug Gregor suggested that a visitor mechanism would allow <b>bind</b> to <p>Doug Gregor suggested that a visitor mechanism would allow <b>bind</b> to
interoperate with a signal/slot library.</p> interoperate with a signal/slot library.</p>
<p>John Maddock fixed a MSVC-specific conflict between <b>bind</b> and the <A href="../type_traits/index.html"> <p>John Maddock fixed a MSVC-specific conflict between <b>bind</b> and the <A href="../type_traits/index.html">

View File

@@ -7,8 +7,7 @@
<body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%"> <body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%">
<table border="0" width="100%"> <table border="0" width="100%">
<tr> <tr>
<td width="277"> <td width="277"><A href="../../index.htm"> <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86" border="0"></A>
<img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86">
</td> </td>
<td align="center"> <td align="center">
<h1>mem_fn.hpp</h1> <h1>mem_fn.hpp</h1>
@@ -168,13 +167,12 @@ void k(std::vector&lt;boost::shared_ptr&lt;X&gt; &gt; const &amp; v)
</p> </p>
<h3><a name="Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?</a></h3> <h3><a name="Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?</a></h3>
<p> <p>
Non-portable extensions, in general, should default to Non-portable extensions, in general, should default to off to prevent vendor
off to prevent vendor lock-in. Had BOOST_MEM_FN_ENABLE_STDCALL been defined lock-in. Had BOOST_MEM_FN_ENABLE_STDCALL been defined automatically, you could
automatically, you could have accidentally taken advantage of have accidentally taken advantage of it without realizing that your code is,
it without realizing that your code is, perhaps, no longer portable. perhaps, no longer portable. In addition, it is possible for the default
In addition, it is possible for the default calling convention to be __stdcall, in which case enabling __stdcall support
calling convention to be __stdcall, in which case enabling __stdcall support will will result in duplicate definitions.
result in duplicate definitions.
</p> </p>
<h2><a name="Interface">Interface</a></h2> <h2><a name="Interface">Interface</a></h2>
<h3><a name="Synopsis">Synopsis</a></h3> <h3><a name="Synopsis">Synopsis</a></h3>
@@ -358,8 +356,8 @@ template&lt;class R, class T, class A1, class A2&gt; <i>unspecified-6</i> <a hre
</p> </p>
<p> <p>
For example, Windows API functions and COM interface member functions use a For example, Windows API functions and COM interface member functions use a
calling convention known as <b>__stdcall</b>. Borland VCL components use <STRONG>__fastcall</STRONG>. UDK, the component model of calling convention known as <b>__stdcall</b>. Borland VCL components use <STRONG>__fastcall</STRONG>.
OpenOffice.org, uses <STRONG>__cdecl</STRONG>. UDK, the component model of OpenOffice.org, uses <STRONG>__cdecl</STRONG>.
</p> </p>
<p> <p>
To use <b>mem_fn</b> with <b>__stdcall</b> member functions, <b>#define</b> the To use <b>mem_fn</b> with <b>__stdcall</b> member functions, <b>#define</b> the
@@ -367,16 +365,15 @@ OpenOffice.org, uses <STRONG>__cdecl</STRONG>.
indirectly, <b>&lt;boost/mem_fn.hpp&gt;</b>. indirectly, <b>&lt;boost/mem_fn.hpp&gt;</b>.
</p> </p>
<P>To use <B>mem_fn</B> with <B>__fastcall</B> member functions, <B>#define</B> the <P>To use <B>mem_fn</B> with <B>__fastcall</B> member functions, <B>#define</B> the
macro <B>BOOST_MEM_FN_ENABLE_FASTCALL</B> before macro <B>BOOST_MEM_FN_ENABLE_FASTCALL</B> before including <B>&lt;boost/mem_fn.hpp&gt;</B>.
including <B>&lt;boost/mem_fn.hpp&gt;</B>.
</P> </P>
<P>To use <B>mem_fn</B> with <B>__cdecl</B> member functions, <B>#define</B> the <P>To use <B>mem_fn</B> with <B>__cdecl</B> member functions, <B>#define</B> the
macro <B>BOOST_MEM_FN_ENABLE_CDECL</B> before including macro <B>BOOST_MEM_FN_ENABLE_CDECL</B> before including <B>&lt;boost/mem_fn.hpp&gt;</B>.
<B>&lt;boost/mem_fn.hpp&gt;</B>. </P> </P>
<P><STRONG>It is best to define these macros in the project options, via -D <P><STRONG>It is best to define these macros in the project options, via -D on the
on the command line, or as the first line in the translation unit (.cpp file) command line, or as the first line in the translation unit (.cpp file) where
where mem_fn is used.</STRONG> Not following this rule can lead to obscure mem_fn is used.</STRONG> Not following this rule can lead to obscure errors
errors when a header includes mem_fn.hpp before the macro has been defined.</P> when a header includes mem_fn.hpp before the macro has been defined.</P>
<P>[Note: this is a non-portable extension. It is not part of the interface.] <P>[Note: this is a non-portable extension. It is not part of the interface.]
</P> </P>
<p> <p>
@@ -401,10 +398,10 @@ errors when a header includes mem_fn.hpp before the macro has been defined.</P>
<p>Daniel Boelzle pointed out that UDK uses <STRONG>__cdecl</STRONG>.<br> <p>Daniel Boelzle pointed out that UDK uses <STRONG>__cdecl</STRONG>.<br>
<br> <br>
<br> <br>
<small>Copyright <20> 2001, 2002 by Peter Dimov and Multi Media Ltd. Copyright 2003-2005 Peter Dimov. Permission <small>Copyright <20> 2001, 2002 by Peter Dimov and Multi Media Ltd. Copyright
to copy, use, modify, sell and distribute this document is granted provided 2003-2005 Peter Dimov. Permission to copy, use, modify, sell and distribute
this copyright notice appears in all copies. This document is provided "as is" this document is granted provided this copyright notice appears in all copies.
without express or implied warranty, and with no claim as to its suitability This document is provided "as is" without express or implied warranty, and with
for any purpose.</small></p> no claim as to its suitability for any purpose.</small></p>
</body> </body>
</html> </html>