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">
<table width="100%" border="0">
<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 align="center">
<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
evaluation, use <tt>protect(bind(f, ...))</tt>.</P>
<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
the logical not operator <STRONG>!</STRONG> and the relational operators <STRONG>==</STRONG>,
<p>For convenience, the function objects produced by <tt>bind</tt> overload the
logical not operator <STRONG>!</STRONG> and the relational operators <STRONG>==</STRONG>,
<STRONG>!=</STRONG>, <STRONG>&lt;</STRONG>, <STRONG>&lt;=</STRONG>, <STRONG>&gt;</STRONG>,
<STRONG>&gt;=</STRONG>.</p>
<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 a function object that takes two arguments <tt>a</tt> and <tt>b</tt> and
returns <tt>a <EM>op</EM> b</tt>.</P>
<P>What this means in practice is that you can conveniently negate the result of
<tt>bind</tt>:</P>
<P>What this means in practice is that you can conveniently negate the result of <tt>bind</tt>:</P>
<P><tt>std::remove_if( first, last, !bind( &amp;X::visible, _1 ) ); // remove invisible
objects</tt></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
Binder Library);
<li>
<a href="http://more.sourceforge.net/">Extensions to the
STL</a> by Petter Urkedal.</li></ul>
<a href="http://more.sourceforge.net/">Extensions to the STL</a> by Petter
Urkedal.</li></ul>
<p>Doug Gregor suggested that a visitor mechanism would allow <b>bind</b> to
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">

View File

@@ -7,8 +7,7 @@
<body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%">
<table border="0" width="100%">
<tr>
<td width="277">
<img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86">
<td width="277"><A href="../../index.htm"> <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86" border="0"></A>
</td>
<td align="center">
<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>
<h3><a name="Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?</a></h3>
<p>
Non-portable extensions, in general, should default to
off to prevent vendor lock-in. Had BOOST_MEM_FN_ENABLE_STDCALL been defined
automatically, you could have accidentally taken advantage of
it without realizing that your code is, perhaps, no longer portable.
In addition, it is possible for the default
calling convention to be __stdcall, in which case enabling __stdcall support will
result in duplicate definitions.
Non-portable extensions, in general, should default to off to prevent vendor
lock-in. Had BOOST_MEM_FN_ENABLE_STDCALL been defined automatically, you could
have accidentally taken advantage of it without realizing that your code is,
perhaps, no longer portable. In addition, it is possible for the default
calling convention to be __stdcall, in which case enabling __stdcall support
will result in duplicate definitions.
</p>
<h2><a name="Interface">Interface</a></h2>
<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>
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
OpenOffice.org, uses <STRONG>__cdecl</STRONG>.
calling convention known as <b>__stdcall</b>. Borland VCL components use <STRONG>__fastcall</STRONG>.
UDK, the component model of OpenOffice.org, uses <STRONG>__cdecl</STRONG>.
</p>
<p>
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>.
</p>
<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
including <B>&lt;boost/mem_fn.hpp&gt;</B>.
macro <B>BOOST_MEM_FN_ENABLE_FASTCALL</B> before including <B>&lt;boost/mem_fn.hpp&gt;</B>.
</P>
<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
<B>&lt;boost/mem_fn.hpp&gt;</B>. </P>
<P><STRONG>It is best to define these macros in the project options, via -D
on the command line, or as the first line in the translation unit (.cpp file)
where mem_fn is used.</STRONG> Not following this rule can lead to obscure
errors when a header includes mem_fn.hpp before the macro has been defined.</P>
macro <B>BOOST_MEM_FN_ENABLE_CDECL</B> before including <B>&lt;boost/mem_fn.hpp&gt;</B>.
</P>
<P><STRONG>It is best to define these macros in the project options, via -D on the
command line, or as the first line in the translation unit (.cpp file) where
mem_fn is used.</STRONG> Not following this rule can lead to obscure errors
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>
<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>
<br>
<br>
<small>Copyright <20> 2001, 2002 by Peter Dimov and Multi Media Ltd. Copyright 2003-2005 Peter Dimov. Permission
to copy, use, modify, sell and distribute this document is granted provided
this copyright notice appears in all copies. This document is provided "as is"
without express or implied warranty, and with no claim as to its suitability
for any purpose.</small></p>
<small>Copyright <20> 2001, 2002 by Peter Dimov and Multi Media Ltd. Copyright
2003-2005 Peter Dimov. Permission to copy, use, modify, sell and distribute
this document is granted provided this copyright notice appears in all copies.
This document is provided "as is" without express or implied warranty, and with
no claim as to its suitability for any purpose.</small></p>
</body>
</html>