forked from boostorg/functional
Fixed license & copyright issues.
From Mark Rodgers Fri Dec 1 12:59:14 2006 X-Apparently-To: ahd6974-boostorg -at- yahoo.com via 68.142.206.160; Fri, 01 Dec 2006 12:59:41 -0800 X-Originating-IP: [195.112.4.54] Return-Path: <mark.rodgers -at- cadenza.co.nz> Authentication-Results: mta550.mail.mud.yahoo.com from=cadenza.co.nz; domainkeys=neutral (no sig) Received: from 195.112.4.54 (EHLO smtp.nildram.co.uk) (195.112.4.54) by mta550.mail.mud.yahoo.com with SMTP; Fri, 01 Dec 2006 12:59:40 -0800 Received: from snagglepuss.cadenza.co.nz (81-6-246-87.dyn.gotadsl.co.uk [81.6.246.87]) by smtp.nildram.co.uk (Postfix) with ESMTP id D32EA2B6D8C for <ahd6974-boostorg -at- yahoo.com>; Fri, 1 Dec 2006 20:59:35 +0000 (GMT) Received: from penfold.cadenza.co.nz ([192.168.55.56]) by snagglepuss.cadenza.co.nz with esmtp (Exim 4.63) (envelope-from <mark.rodgers -at- cadenza.co.nz>) id J9M4Y9-0009TO-9K for ahd6974-boostorg -at- yahoo.com; Fri, 01 Dec 2006 20:58:57 +0000 Message-ID: <457097A2.1090305@cadenza.co.nz> Date: Fri, 01 Dec 2006 20:59:14 +0000 From: "Mark Rodgers" <mark.rodgers -at- cadenza.co.nz> User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: ahd6974-boostorg -at- yahoo.com [Edit - Delete] Subject: Re: [boost] Reminder: Need your permission to correct license & copyright issues References: <379990.36007.qm@web33507.mail.mud.yahoo.com> In-Reply-To: <379990.36007.qm@web33507.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Length: 812 Gidday Andreas Sure that's fine. I'm happy for you to do 1, 2 and 3. Regards Mark Andreas Huber wrote: > Hello Mark > > Quite a while ago it was decided that every file that goes into the > 1.34 release of the Boost distribution (www.boost.org) needs uniform > license and copyright information. For more information please see: > > <http://www.boost.org/more/license_info.html> > > You are receiving this email because several files you contributed > lack such information or have an old license: > > boost/functional/functional.hpp > boost/libs/functional/binders.html > boost/libs/functional/function_test.cpp > boost/libs/functional/function_traits.html > boost/libs/functional/index.html > boost/libs/functional/mem_fun.html > boost/libs/functional/negators.html > boost/libs/functional/ptr_fun.html > boost/people/mark_rodgers.htm > > I therefore kindly ask you to grant the permission to do the > following: > > 1. For the files above that already have a license text (all except > mark_rodgers.htm), replace the license text with: > > "Distributed under the Boost Software License, Version 1.0. (See > accompanying file LICENSE_1_0.txt or copy at > http://www.boost.org/LICENSE_1_0.txt)" > > 2. For the file that does not yet have a license and copyright > (mark_rodgers.htm) add the same license text as under 1. and add the > following copyright: > > "(c) Copyright Mark Rodgers 2000" > > 3. (Optional) I would also want to convert all HTML files to conform > the HTML 4.01 Standard by running them through HTML Tidy, see > <http://tidy.sf.net> > > It would be great if you could grant me permission to do 1 & 2 and > optionally also 3. > > Thank you! > > Regards, > > Andreas Huber > [SVN r36245]
This commit is contained in:
+105
-76
@@ -1,132 +1,161 @@
|
||||
<html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Boost Function Object Adapter Library</title>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||
|
||||
<title>Boost Function Object Adapter Library</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
<table border="1" bgcolor="#007F7F" cellpadding="2" summary="">
|
||||
<tr>
|
||||
<td bgcolor="#FFFFFF"><img src="../../boost.png" alt=
|
||||
"boost.png (6897 bytes)" width="277" height="86"></td>
|
||||
|
||||
<table border="1" bgcolor="#007F7F" cellpadding="2">
|
||||
<tr>
|
||||
<td bgcolor="#FFFFFF"><img src="../../boost.png" alt="boost.png (6897 bytes)" WIDTH="277" HEIGHT="86"></td>
|
||||
<td><a href="../../index.htm"><font face="Arial" color="#FFFFFF"><big>Home </big></font></a></td>
|
||||
<td><a href="../libraries.htm"><font face="Arial" color="#FFFFFF"><big>Libraries </big></font></a></td>
|
||||
<td><a href="../../people/people.htm"><font face="Arial" color="#FFFFFF"><big>People </big></font></a></td>
|
||||
<td><a href="../../more/faq.htm"><font face="Arial" color="#FFFFFF"><big>FAQ </big></font></a></td>
|
||||
<td><a href="../../more/index.htm"><font face="Arial" color="#FFFFFF"><big>More </big></font></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<td><a href="../../index.htm"><font face="Arial" color=
|
||||
"#FFFFFF"><big>Home</big></font></a></td>
|
||||
|
||||
<h1>Binders</h1>
|
||||
<td><a href="../libraries.htm"><font face="Arial" color=
|
||||
"#FFFFFF"><big>Libraries</big></font></a></td>
|
||||
|
||||
<p>The header <nobr><a
|
||||
href="../../boost/functional.hpp">functional.hpp</a></nobr> provides
|
||||
enhanced versions of both the binder function object adapters from the
|
||||
C++ Standard Library <nobr>(§20.3.6):</nobr></p>
|
||||
<td><a href="../../people/people.htm"><font face="Arial" color=
|
||||
"#FFFFFF"><big>People</big></font></a></td>
|
||||
|
||||
<ul>
|
||||
<li><tt>binder1st</tt></li>
|
||||
<li><tt>binder2nd</tt></li>
|
||||
</ul>
|
||||
<td><a href="../../more/faq.htm"><font face="Arial" color=
|
||||
"#FFFFFF"><big>FAQ</big></font></a></td>
|
||||
|
||||
<p>As well as the corresponding helper functions</p>
|
||||
<td><a href="../../more/index.htm"><font face="Arial" color=
|
||||
"#FFFFFF"><big>More</big></font></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li><tt>bind1st</tt></li>
|
||||
<li><tt>bind2nd</tt></li>
|
||||
</ul>
|
||||
<h1>Binders</h1>
|
||||
|
||||
<p>The key benefit of these adapters over those in the Standard
|
||||
Library is they avoid the problem of <a href="#refref">references to
|
||||
references.</a>
|
||||
<p>The header <a href="../../boost/functional.hpp">functional.hpp</a>
|
||||
provides enhanced versions of both the binder function object adapters from
|
||||
the C++ Standard Library (§20.3.6):</p>
|
||||
|
||||
<h3>Usage</h3>
|
||||
<ul>
|
||||
<li><tt>binder1st</tt></li>
|
||||
|
||||
<p>Usage is identical to the standard binders. For example,</p>
|
||||
<li><tt>binder2nd</tt></li>
|
||||
</ul>
|
||||
|
||||
<blockquote><pre>
|
||||
<p>As well as the corresponding helper functions</p>
|
||||
|
||||
<ul>
|
||||
<li><tt>bind1st</tt></li>
|
||||
|
||||
<li><tt>bind2nd</tt></li>
|
||||
</ul>
|
||||
|
||||
<p>The key benefit of these adapters over those in the Standard Library is
|
||||
they avoid the problem of <a href="#refref">references to
|
||||
references.</a></p>
|
||||
|
||||
<h3>Usage</h3>
|
||||
|
||||
<p>Usage is identical to the standard binders. For example,</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
class Foo {
|
||||
public:
|
||||
void bar(std::ostream &);
|
||||
void bar(std::ostream &);
|
||||
// ...
|
||||
};
|
||||
// ...
|
||||
std::vector<Foo> c;
|
||||
// ...
|
||||
std::for_each(c.begin(), c.end(),
|
||||
boost::bind2nd(boost::mem_fun_ref(&Foo::bar), std::cout));
|
||||
</pre></blockquote>
|
||||
boost::bind2nd(boost::mem_fun_ref(&Foo::bar), std::cout));
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<h3 id="refref">References to References</h3>
|
||||
<h3 id="refref">References to References</h3>
|
||||
|
||||
<p>Consider the usage example above</p>
|
||||
<p>Consider the usage example above</p>
|
||||
|
||||
<blockquote><pre>
|
||||
<blockquote>
|
||||
<pre>
|
||||
class Foo {
|
||||
public:
|
||||
void bar(<strong>std::ostream &</strong>);
|
||||
void bar(<strong>std::ostream &</strong>);
|
||||
// ...
|
||||
};
|
||||
// ...
|
||||
std::for_each(c.begin(), c.end(),
|
||||
boost::bind2nd(boost::mem_fun_ref(&Foo::bar), std::cout));
|
||||
</pre></blockquote>
|
||||
boost::bind2nd(boost::mem_fun_ref(&Foo::bar), std::cout));
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>If this had been written using <tt><nobr>std::bind2nd</nobr></tt>
|
||||
and <tt><nobr>std::mem_fun_ref</nobr></tt>, it would be unlikely to
|
||||
compile.</p>
|
||||
<p>If this had been written using <tt>std::bind2nd</tt> and
|
||||
<tt>std::mem_fun_ref</tt>, it would be unlikely to compile.</p>
|
||||
|
||||
<p>The problem arises because <tt><nobr>bar</nobr></tt> takes a
|
||||
reference argument. The Standard defines
|
||||
<tt><nobr>std::mem_fun_ref</nobr></tt> such that it creates a function
|
||||
object whose <tt><nobr>second_argument_type</nobr></tt> will be
|
||||
<tt><nobr>std::ostream&</nobr></tt>.</p>
|
||||
<p>The problem arises because <tt>bar</tt> takes a reference argument. The
|
||||
Standard defines <tt>std::mem_fun_ref</tt> such that it creates a function
|
||||
object whose <tt>second_argument_type</tt> will be
|
||||
<tt>std::ostream&</tt>.</p>
|
||||
|
||||
<p>The call to <tt><nobr>bind2nd</nobr></tt> creates a
|
||||
<tt><nobr>binder2nd</nobr></tt> which the Standard defines as follows:
|
||||
<p>The call to <tt>bind2nd</tt> creates a <tt>binder2nd</tt> which the
|
||||
Standard defines as follows:</p>
|
||||
|
||||
<blockquote><pre>
|
||||
<blockquote>
|
||||
<pre>
|
||||
template <class Operation>
|
||||
class binder2nd
|
||||
: public unary_function<typename Operation::first_argument_type,
|
||||
typename Operation::result_type> {
|
||||
...
|
||||
public:
|
||||
binder2nd(const Operation& x,
|
||||
<strong>const typename Operation::second_argument_type& y</strong>);
|
||||
binder2nd(const Operation& x,
|
||||
<strong>const typename Operation::second_argument_type& y</strong>);
|
||||
...
|
||||
</pre></blockquote>
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>Since our operation's <tt><nobr>second_argument_type</nobr></tt> is
|
||||
<tt><nobr>std::ostream&</nobr></tt>, the type of <tt>y</tt> in the
|
||||
constructor would be <tt><nobr>std::ostream&&</nobr></tt>. Since you
|
||||
cannot have a reference to a reference, at this point we should get a
|
||||
compilation error because references to references are illegal in C++
|
||||
(but see <a
|
||||
href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#106">
|
||||
C++ Standard core language active issues list</a>).</p>
|
||||
<p>Since our operation's <tt>second_argument_type</tt> is
|
||||
<tt>std::ostream&</tt>, the type of <tt>y</tt> in the constructor would
|
||||
be <tt>std::ostream&&</tt>. Since you cannot have a reference to a
|
||||
reference, at this point we should get a compilation error because
|
||||
references to references are illegal in C++ (but see <a href=
|
||||
"http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#106">C++
|
||||
Standard core language active issues list</a>).</p>
|
||||
|
||||
<p>The binders in this library avoid this problem by using the Boost
|
||||
<nobr><tt><a
|
||||
href="../utility/call_traits.htm">call_traits</a></tt></nobr> templates.</p>
|
||||
<p>The binders in this library avoid this problem by using the Boost
|
||||
<tt><a href="../utility/call_traits.htm">call_traits</a></tt>
|
||||
templates.</p>
|
||||
|
||||
<p>Our constructor is declared
|
||||
<p>Our constructor is declared</p>
|
||||
|
||||
<blockquote><pre>
|
||||
binder2nd(const Operation& x,
|
||||
<blockquote>
|
||||
<pre>
|
||||
binder2nd(const Operation& x,
|
||||
<strong>typename call_traits<
|
||||
typename binary_traits<Operation>::second_argument_type
|
||||
>::param_type y</strong>)
|
||||
</pre></blockquote>
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>As a result, <tt>y</tt> has a type of <tt><nobr>std::ostream&</nobr></tt>,
|
||||
and our example compiles.</p>
|
||||
<p>As a result, <tt>y</tt> has a type of <tt>std::ostream&</tt>, and
|
||||
our example compiles.</p>
|
||||
<hr>
|
||||
|
||||
<hr>
|
||||
<p>Copyright © 2000 Cadenza New Zealand Ltd. 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.</p>
|
||||
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
|
||||
"http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional"
|
||||
height="31" width="88"></a></p>
|
||||
|
||||
<p>Revised 28 June 2000</p>
|
||||
<p>Revised
|
||||
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->02
|
||||
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38510" --></p>
|
||||
|
||||
<p><i>Copyright © 2000 Cadenza New Zealand Ltd.</i></p>
|
||||
|
||||
<p><i>Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||
copy at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user