Compare commits

..

27 Commits

Author SHA1 Message Date
Rene Rivera
79049d7f06 Cleanup release tags.
[SVN r44324]
2008-04-12 05:22:07 +00:00
nobody
d90fe7edd5 This commit was manufactured by cvs2svn to create tag
'Version_1_31_0'.

[SVN r22162]
2004-02-04 15:24:32 +00:00
nobody
5a7c54832f This commit was manufactured by cvs2svn to create branch 'RC_1_31_0'.
[SVN r21427]
2003-12-30 12:10:04 +00:00
Beman Dawes
f91de70d8e type_traits.htm now type_traits.html
[SVN r21232]
2003-12-11 23:35:43 +00:00
Douglas Gregor
4b97a70f64 Redirects to BoostBook-generated documentation
[SVN r21183]
2003-12-08 14:18:22 +00:00
Peter Dimov
7feefb7313 _MSC_VER use clarified.
[SVN r20992]
2003-11-28 15:35:21 +00:00
Vladimir Prus
46ae046f41 Add V2 Jamfile.
[SVN r20208]
2003-09-29 15:37:57 +00:00
Peter Dimov
673d6b0bf0 Fixed VC7 regression
[SVN r20088]
2003-09-17 11:56:22 +00:00
Dave Abrahams
9ca672c10d CWPro8.3 bug workaround
[SVN r19993]
2003-09-10 15:37:59 +00:00
Dave Abrahams
016a3b8d96 Use the import rule
[SVN r19968]
2003-09-08 17:38:49 +00:00
Peter Dimov
6ed01de60f -Wundef fixes.
[SVN r18788]
2003-06-12 17:09:24 +00:00
Peter Dimov
5f95e4d9de Support for noncopyable function objects (boost::signal)
[SVN r18615]
2003-05-30 17:00:14 +00:00
Peter Dimov
90069948ec Const-correctness patch extended to the NO_VOID_RETURNS code path.
[SVN r18332]
2003-04-29 13:28:57 +00:00
Peter Dimov
367728cafe Bound arguments are now no more const than the object itself.
[SVN r18296]
2003-04-23 22:14:40 +00:00
Douglas Gregor
4be201beba Updated to reflect BoostBook changes
[SVN r17941]
2003-03-15 23:12:35 +00:00
Douglas Gregor
04a438f5f4 Lots of cleanups as BoostBook becomes more strict
[SVN r17871]
2003-03-13 00:29:57 +00:00
Douglas Gregor
b06f6a6d89 Move away from attributes, toward elements
[SVN r17869]
2003-03-13 00:08:34 +00:00
Douglas Gregor
81c8af90ec Import of BoostBook documentation for any, array, bind, function, ref, and
signals libraries.


[SVN r17866]
2003-03-12 23:27:25 +00:00
Peter Dimov
c9db3c51ea Fixed some links.
[SVN r17670]
2003-02-27 11:58:50 +00:00
Peter Dimov
8c09072ead Added copyright to Jamfiles.
[SVN r17363]
2003-02-13 15:41:26 +00:00
Peter Dimov
4876b82a73 Moved bind tests to a subinclude.
[SVN r17030]
2003-01-24 16:05:26 +00:00
Peter Dimov
7b7784d470 Metrowerks precompiled header fix (Bertolt Mildner)
[SVN r16731]
2003-01-02 11:55:47 +00:00
Dave Abrahams
eca328b27c Factor out get_pointer, supply an overload for std::auto_ptr.
[SVN r16672]
2002-12-20 18:15:01 +00:00
Peter Dimov
ad46d513d7 Documented new bind(type<R>(), f, ...) syntax.
[SVN r15932]
2002-10-15 12:45:49 +00:00
Peter Dimov
cc3ebc18b8 Fix for Compaq C++ (Ralf W. Grosse-Kunstleve)
[SVN r15929]
2002-10-15 10:57:08 +00:00
Peter Dimov
5a10daef4d bind(type<R>(), f, ...) alternative syntax support.
[SVN r15928]
2002-10-15 10:51:34 +00:00
Peter Dimov
51e4031aaf Fixed g++ 2.95 problem with bind<void>(...) (reported by Alkis Evlogimenos)
[SVN r15923]
2002-10-14 16:35:26 +00:00
23 changed files with 919 additions and 816 deletions

906
bind.html

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

242
doc/ref.xml Normal file
View File

@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<library name="Ref" dirname="ref" id="ref" last-revision="$Date$">
<libraryinfo>
<author>
<firstname>Jaakko</firstname>
<surname>J&auml;rvi</surname>
</author>
<author>
<firstname>Peter</firstname>
<surname>Dimov</surname>
</author>
<author>
<firstname>Douglas</firstname>
<surname>Gregor</surname>
</author>
<author>
<firstname>Dave</firstname>
<surname>Abrahams</surname>
</author>
<copyright>
<year>1999</year>
<year>2000</year>
<holder>Jaakko J&auml;rvi</holder>
</copyright>
<copyright>
<year>2001</year>
<year>2002</year>
<holder>Peter Dimov</holder>
</copyright>
<copyright>
<year>2002</year>
<holder>David Abrahams</holder>
</copyright>
<legalnotice>
<para>Permission to copy, use, modify, sell and distribute this
software is granted provided this copyright notice appears in
all copies. This software is provided "as is" without express
or implied warranty, and with no claim as to its suitability for
any purpose.
</para>
</legalnotice>
<librarypurpose>A utility library for passing references to generic functions</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
<title>Boost.Ref</title>
<section id="ref.intro">
<title>Introduction</title>
<using-namespace name="boost"/>
<para>The Ref library is a small library that is useful for passing
references to function templates (algorithms) that would usually
take copies of their arguments. It defines the class template
<code><classname>boost::reference_wrapper&lt;T&gt;</classname></code>,
the two functions
<code><functionname>boost::ref</functionname></code> and
<code><functionname>boost::cref</functionname></code> that return
instances of <code>boost::reference_wrapper&lt;T&gt;</code>, and the
two traits classes
<code><classname>boost::is_reference_wrapper&lt;T&gt;</classname></code>
and
<code><classname>boost::unwrap_reference&lt;T&gt;</classname></code>.</para>
<para>The purpose of
<code>boost::reference_wrapper&lt;T&gt;</code> is to
contain a reference to an object of type T. It is primarily used to
"feed" references to function templates (algorithms) that take their
parameter by value.</para>
<para>To support this usage,
<code>boost::reference_wrapper&lt;T&gt;</code> provides an implicit
conversion to <code>T&amp;</code>. This usually allows the function
templates to work on references unmodified.</para>
<para><code>boost::reference_wrapper&lt;T&gt;</code> is
both CopyConstructible and Assignable (ordinary references are not
Assignable).</para>
<para>The expression <code>boost::ref(x)</code>
returns a
<code>boost::reference_wrapper&lt;X&gt;(x)</code> where X
is the type of x. Similarly,
<code>boost::cref(x)</code> returns a
<code>boost::reference_wrapper&lt;X const&gt;(x)</code>.</para>
<para>The expression
<code>boost::is_reference_wrapper&lt;T&gt;::value</code>
is true if T is a <code>reference_wrapper</code>, and
false otherwise.</para>
<para>The type-expression
<code>boost::unwrap_reference&lt;T&gt;::type</code> is T::type if T
is a <code>reference_wrapper</code>, T otherwise.</para>
</section>
<library-reference>
<header name="boost/ref.hpp">
<namespace name="boost">
<class name="reference_wrapper">
<template>
<template-type-parameter name="T"/>
</template>
<purpose>
Contains a reference to an object of type
<computeroutput>T</computeroutput>.
</purpose>
<description>
<para><computeroutput><classname>reference_wrapper</classname></computeroutput>
is primarily used to "feed" references to function templates
(algorithms) that take their parameter by value. It provides
an implicit conversion to
<computeroutput>T&amp;</computeroutput>, which usually allows
the function templates to work on references
unmodified.</para>
</description>
<typedef name="type"><type>T</type></typedef>
<constructor specifiers="explicit">
<parameter name="t">
<paramtype>T&amp;</paramtype>
</parameter>
<effects><simpara>Constructs a
<computeroutput><classname>reference_wrapper</classname></computeroutput>
object that stores a reference to
<computeroutput>t</computeroutput>.</simpara></effects>
<throws><simpara>Does not throw.</simpara></throws>
</constructor>
<method-group name="access">
<method name="conversion-operator" cv="const">
<type>T&amp;</type>
<returns><simpara>The stored reference.</simpara></returns>
<throws><simpara>Does not throw.</simpara></throws>
</method>
<method name="get" cv="const">
<type>T&amp;</type>
<returns><simpara>The stored reference.</simpara></returns>
<throws><simpara>Does not throw.</simpara></throws>
</method>
<method name="get_pointer" cv="const">
<type>T*</type>
<returns><simpara>A pointer to the object referenced by the stored reference.</simpara></returns>
<throws><simpara>Does not throw.</simpara></throws>
</method>
</method-group>
<free-function-group name="constructors">
<function name="ref">
<type>reference_wrapper&lt;T&gt;</type>
<parameter name="t">
<paramtype>T&amp;</paramtype>
</parameter>
<returns><simpara><computeroutput><classname>reference_wrapper</classname>&lt;T&gt;(t)</computeroutput></simpara></returns>
<throws><simpara>Does not throw.</simpara></throws>
</function>
<function name="cref">
<type>reference_wrapper&lt;T const&gt;</type>
<parameter name="t">
<paramtype>T const&amp;</paramtype>
</parameter>
<returns><simpara><computeroutput><classname>reference_wrapper</classname>&lt;T const&gt;(t)</computeroutput></simpara></returns>
<throws><simpara>Does not throw.</simpara></throws>
</function>
</free-function-group>
</class>
<class name="is_reference_wrapper">
<template>
<template-type-parameter name="T"/>
</template>
<purpose>Determine if a type <computeroutput>T</computeroutput> is an instantiation of <computeroutput><classname>reference_wrapper</classname></computeroutput>.</purpose>
<description>
<para>The <computeroutput>value</computeroutput> static
constant will be <computeroutput>true</computeroutput> iff the
type <computeroutput>T</computeroutput> is a specialization of
<computeroutput><classname>reference_wrapper</classname></computeroutput>.</para>
</description>
<static-constant name="value">
<type>bool</type>
<default><emphasis>unspecified</emphasis></default>
</static-constant>
</class>
<class name="unwrap_reference">
<template>
<template-type-parameter name="T"/>
</template>
<purpose>Find the type in a <computeroutput><classname>reference_wrapper</classname></computeroutput>.</purpose>
<description>
<para>The typedef <computeroutput>type</computeroutput> is
<computeroutput>T::type</computeroutput> if
<computeroutput>T</computeroutput> is a
<computeroutput><classname>reference_wrapper</classname></computeroutput>,
<computeroutput>T</computeroutput> otherwise.</para>
</description>
<typedef name="T"><type><emphasis>unspecified</emphasis></type></typedef>
</class>
</namespace>
</header>
</library-reference>
<section id="ref.ack">
<title>Acknowledgements</title>
<using-namespace name="boost"/>
<para><functionname>ref</functionname> and <functionname>cref</functionname>
were originally part of the <libraryname>Tuple</libraryname> library
by Jaakko J&auml;rvi. They were "promoted to boost:: status" by
Peter Dimov because they are generally useful. Douglas Gregor and
Dave Abrahams contributed
<classname>is_reference_wrapper</classname> and
<classname>unwrap_reference</classname>.</para>
</section>
</library>

View File

@@ -1,8 +1,10 @@
#ifndef BOOST_BIND_HPP_INCLUDED
#define BOOST_BIND_HPP_INCLUDED
#if _MSC_VER >= 1020
#pragma once
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
@@ -22,6 +24,7 @@
#include <boost/config.hpp>
#include <boost/ref.hpp>
#include <boost/mem_fn.hpp>
#include <boost/type.hpp>
#include <boost/bind/arg.hpp>
// Borland-specific bug, visit_each() silently fails to produce code
@@ -140,6 +143,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A &)
{
return unwrap(f, 0)();
}
template<class R, class F, class A> R operator()(type<R>, F f, A &) const
{
return unwrap(f, 0)();
@@ -180,6 +188,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_]);
@@ -228,6 +241,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_]);
@@ -280,6 +298,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
@@ -336,6 +359,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
@@ -396,6 +424,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
@@ -460,6 +493,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
@@ -528,6 +566,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
@@ -600,6 +643,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
@@ -676,6 +724,11 @@ public:
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
template<class R, class F, class A> R operator()(type<R>, F f, A & a)
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
}
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
@@ -723,7 +776,7 @@ private:
template <class R> struct evaluator0
{
template<class L, class F, class A>
static R eval(L const&, F f, A &)
static R eval(L &, F f, A &)
{
return unwrap(f, 0)();
}
@@ -732,7 +785,7 @@ template <class R> struct evaluator0
template <> struct evaluator0<void>
{
template<class L, class F, class A>
static void eval(L const&, F f, A &)
static void eval(L &, F f, A &)
{
unwrap(f, 0)();
}
@@ -741,7 +794,7 @@ template <> struct evaluator0<void>
template <class R> struct evaluator1
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_]);
}
@@ -750,7 +803,7 @@ template <class R> struct evaluator1
template <> struct evaluator1<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_]);
}
@@ -759,7 +812,7 @@ template <> struct evaluator1<void>
template <class R> struct evaluator2
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_]);
}
@@ -768,7 +821,7 @@ template <class R> struct evaluator2
template <> struct evaluator2<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_]);
}
@@ -777,7 +830,7 @@ template <> struct evaluator2<void>
template <class R> struct evaluator3
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
}
@@ -786,7 +839,7 @@ template <class R> struct evaluator3
template <> struct evaluator3<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
}
@@ -795,7 +848,7 @@ template <> struct evaluator3<void>
template <class R> struct evaluator4
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
}
@@ -804,7 +857,7 @@ template <class R> struct evaluator4
template <> struct evaluator4<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
}
@@ -813,7 +866,7 @@ template <> struct evaluator4<void>
template <class R> struct evaluator5
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
}
@@ -822,7 +875,7 @@ template <class R> struct evaluator5
template <> struct evaluator5<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
}
@@ -831,7 +884,7 @@ template <> struct evaluator5<void>
template <class R> struct evaluator6
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
}
@@ -840,7 +893,7 @@ template <class R> struct evaluator6
template <> struct evaluator6<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
}
@@ -849,7 +902,7 @@ template <> struct evaluator6<void>
template <class R> struct evaluator7
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
}
@@ -858,7 +911,7 @@ template <class R> struct evaluator7
template <> struct evaluator7<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
}
@@ -867,7 +920,7 @@ template <> struct evaluator7<void>
template <class R> struct evaluator8
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
}
@@ -876,7 +929,7 @@ template <class R> struct evaluator8
template <> struct evaluator8<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
}
@@ -885,7 +938,7 @@ template <> struct evaluator8<void>
template <class R> struct evaluator9
{
template<class L, class F, class A>
static R eval(L const& l, F f, A & a)
static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
}
@@ -894,7 +947,7 @@ template <class R> struct evaluator9
template <> struct evaluator9<void>
{
template<class L, class F, class A>
static void eval(L const& l, F f, A & a)
static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
}
@@ -1133,6 +1186,18 @@ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, c
typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
};
// g++ 2.95 specific helper; used by the data member overload
template<class T> struct add_cref
{
typedef T const & type;
};
template<> struct add_cref<void>
{
typedef void type;
};
} // namespace _bi
// visit_each
@@ -1235,6 +1300,88 @@ template<class R, class F, class A1, class A2, class A3, class A4, class A5, cla
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
}
// generic function objects, alternative syntax
template<class R, class F>
_bi::bind_t<R, F, _bi::list0>
BOOST_BIND(boost::type<R>, F f)
{
typedef _bi::list0 list_type;
return _bi::bind_t<R, F, list_type> (f, list_type());
}
template<class R, class F, class A1>
_bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1)
{
typedef typename _bi::list_av_1<A1>::type list_type;
return _bi::bind_t<R, F, list_type> (f, list_type(a1));
}
template<class R, class F, class A1, class A2>
_bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
{
typedef typename _bi::list_av_2<A1, A2>::type list_type;
return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
}
template<class R, class F, class A1, class A2, class A3>
_bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
{
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
}
template<class R, class F, class A1, class A2, class A3, class A4>
_bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
{
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
}
template<class R, class F, class A1, class A2, class A3, class A4, class A5>
_bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
{
typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
}
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
_bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
{
typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
}
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
_bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
{
typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
}
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
_bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
{
typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
}
template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
_bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
{
typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
}
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
// adaptable function objects
@@ -1403,8 +1550,21 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
// data member pointers
#if defined(__GNUC__) && (__GNUC__ == 2)
template<class R, class T, class A1>
_bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
_bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
BOOST_BIND(R T::*f, A1 a1)
{
typedef _mfi::dm<R, T> F;
typedef typename _bi::list_av_1<A1>::type list_type;
return _bi::bind_t<typename _bi::add_cref<R>::type, F, list_type>(F(f), list_type(a1));
}
#else
template<class R, class T, class A1>
_bi::bind_t< R const &, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
BOOST_BIND(R T::*f, A1 a1)
{
typedef _mfi::dm<R, T> F;
@@ -1412,6 +1572,8 @@ template<class R, class T, class A1>
return _bi::bind_t<R const &, F, list_type>(F(f), list_type(a1));
}
#endif
} // namespace boost
#ifndef BOOST_BIND_NO_PLACEHOLDERS

View File

@@ -4,7 +4,7 @@
//
// apply.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
@@ -19,52 +19,52 @@ template<class R> struct apply
{
typedef R result_type;
template<class F> result_type operator()(F f) const
template<class F> result_type operator()(F & f) const
{
return f();
}
template<class F, class A1> result_type operator()(F f, A1 & a1) const
template<class F, class A1> result_type operator()(F & f, A1 & a1) const
{
return f(a1);
}
template<class F, class A1, class A2> result_type operator()(F f, A1 & a1, A2 & a2) const
template<class F, class A1, class A2> result_type operator()(F & f, A1 & a1, A2 & a2) const
{
return f(a1, a2);
}
template<class F, class A1, class A2, class A3> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3) const
template<class F, class A1, class A2, class A3> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3) const
{
return f(a1, a2, a3);
}
template<class F, class A1, class A2, class A3, class A4> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
template<class F, class A1, class A2, class A3, class A4> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
{
return f(a1, a2, a3, a4);
}
template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
{
return f(a1, a2, a3, a4, a5);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
{
return f(a1, a2, a3, a4, a5, a6);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
{
return f(a1, a2, a3, a4, a5, a6, a7);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
{
return f(a1, a2, a3, a4, a5, a6, a7, a8);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
{
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}

View File

@@ -1,8 +1,10 @@
#ifndef BOOST_BIND_ARG_HPP_INCLUDED
#define BOOST_BIND_ARG_HPP_INCLUDED
#if _MSC_VER >= 1020
#pragma once
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//

View File

@@ -1,8 +1,10 @@
#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
#if _MSC_VER >= 1020
#pragma once
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
@@ -36,7 +38,7 @@ static inline boost::arg<7> _7() { return boost::arg<7>(); }
static inline boost::arg<8> _8() { return boost::arg<8>(); }
static inline boost::arg<9> _9() { return boost::arg<9>(); }
#elif defined(BOOST_MSVC) && BOOST_MSVC <= 1300
#elif (defined(BOOST_MSVC) && BOOST_MSVC <= 1300) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__)
static boost::arg<1> _1;
static boost::arg<2> _2;

View File

@@ -1,8 +1,10 @@
#ifndef BOOST_MEM_FN_HPP_INCLUDED
#define BOOST_MEM_FN_HPP_INCLUDED
#if _MSC_VER+0 >= 1020
#pragma once
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
@@ -20,19 +22,12 @@
//
#include <boost/config.hpp>
#include <boost/get_pointer.hpp>
#include <boost/detail/workaround.hpp>
namespace boost
{
// get_pointer(p) extracts a ->* capable pointer from p
template<class T> T * get_pointer(T * p)
{
return p;
}
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
#if defined(BOOST_NO_VOID_RETURNS)
#define BOOST_MEM_FN_CLASS_F , class F
@@ -300,7 +295,7 @@ public:
return call(u, &u);
}
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300)
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
R & operator()(T & t) const
{

View File

@@ -321,13 +321,19 @@ template&lt;class R, class T, class A1, class A2&gt; <i>unspecified-6</i> <a hre
<a href="../../boost/bind/mem_fn_template.hpp">boost/bind/mem_fn_template.hpp</a>
(used by mem_fn.hpp, do not include directly)
<li>
<a href="mem_fn_test.cpp">libs/bind/mem_fn_test.cpp</a>
<a href="test/mem_fn_test.cpp">libs/bind/test/mem_fn_test.cpp</a>
(test)
<li>
<a href="mem_fn_stdcall_test.cpp">libs/bind/mem_fn_stdcall_test.cpp</a>
<a href="test/mem_fn_derived_test.cpp">libs/bind/test/mem_fn_derived_test.cpp</a>
(test with derived objects)
<li>
<a href="test/mem_fn_fastcall_test.cpp">libs/bind/test/mem_fn_fastcall_test.cpp</a>
(test for __fastcall)
<li>
<a href="test/mem_fn_stdcall_test.cpp">libs/bind/test/mem_fn_stdcall_test.cpp</a>
(test for __stdcall)
<li>
<a href="mem_fn_void_test.cpp">libs/bind/mem_fn_void_test.cpp</a> (test for
<a href="test/mem_fn_void_test.cpp">libs/bind/test/mem_fn_void_test.cpp</a> (test for
void returns)</li>
</ul>
<h3><a name="Dependencies">Dependencies</a></h3>

200
ref.html
View File

@@ -1,195 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost: ref.hpp documentation</title>
</head>
<body bgcolor="White">
<table border="0" width="100%">
<tr>
<td width="277">
<img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86">
</td>
<td align="center">
<table border="0">
<tr>
<td nowrap><h1>ref.hpp</h1>
</td>
</tr>
<tr>
<td align="right" nowrap><small>&nbsp;1.00.0004 (2002-01-27)</small></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" height="64">&nbsp;</td>
</tr>
</table>
<h2>Files</h2>
<ul>
<li>
<a href="../../boost/ref.hpp">ref.hpp</a>
</ul>
<h2>Purpose</h2>
<p>
The header <a href="../../boost/ref.hpp">boost/ref.hpp</a> defines the class
template <b>boost::reference_wrapper&lt;T&gt;</b>, the two functions <b>boost::ref</b>
and <b>boost::cref</b> that return instances of <b>boost::reference_wrapper&lt;T&gt;</b>,
and the two traits classes <b>boost::is_reference_wrapper&lt;T&gt;</b> and <b>boost::unwrap_reference&lt;T&gt;</b>.
</p>
<p>
The purpose of <b>boost::reference_wrapper&lt;T&gt;</b> is to contain a
reference to an object of type <b>T</b>. It is primarily used to "feed"
references to function templates (algorithms) that take their parameter by
value.
</p>
<p>
To support this usage, <b>boost::reference_wrapper&lt;T&gt;</b> provides an
implicit conversion to <b>T &amp;</b>. This usually allows the function
templates to work on references unmodified.
</p>
<p>
<b>boost::reference_wrapper&lt;T&gt;</b> is both <b>CopyConstructible</b> and <b>Assignable</b>
(ordinary references are not <b>Assignable</b>).
</p>
<p>
The expression <b>boost::ref(x)</b> returns a <b>boost::reference_wrapper&lt;X&gt;(x)</b>
where <b>X</b> is the type of <b>x</b>. Similarly, <b>boost::cref(x)</b> returns
a <b>boost::reference_wrapper&lt;X const&gt;(x)</b>.
</p>
<p>
The expression <b>boost::is_reference_wrapper&lt;T&gt;::value</b> is <b>true</b>
if <b>T</b> is a <b>reference_wrapper</b>, and <b>false</b>
otherwise.
</p>
<p>
The type-expression <b>boost::unwrap_reference&lt;T&gt;::type</b> is <b>T::type</b>
if <b>T</b> is a <b>reference_wrapper</b>, <b>T</b> otherwise.
</p>
<h2>Interface</h2>
<h3>Synopsis</h3>
<pre>
namespace boost
{
template&lt;class T&gt; class <a href="#reference_wrapper">reference_wrapper</a>;
template&lt;class T&gt; reference_wrapper&lt;T&gt; <a href="#ref">ref</a>(T &amp; t);
template&lt;class T&gt; reference_wrapper&lt;T const&gt; <a href="#cref">cref</a>(T const &amp; t);
template&lt;class T&gt; class is_reference_wrapper&lt;T const&gt;;
template&lt;class T&gt; class unwrap_reference&lt;T const&gt;;
}
</pre>
<h3><a name="reference_wrapper">reference_wrapper</a></h3>
<pre>
template&lt;class T&gt; class reference_wrapper
{
public:
typedef T type;
explicit <a href="#rt_construct">reference_wrapper</a>(T &amp; t);
<a href="#rt_operator">operator T &amp;</a> () const;
T &amp; <a href="#rt_get">get</a>() const;
T* <a href="#rt_get_pointer">get_pointer</a>() const;
};
</pre>
<h4><a name="rt_construct">explicit reference_wrapper(T &amp; t)</a></h4>
<blockquote>
<p>
<b>Effects:</b> Constructs a <b>reference_wrapper</b> object that stores a
reference to <b>t</b>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h4><a name="rt_operator">operator T &amp; () const</a></h4>
<blockquote>
<p>
<b>Returns:</b> the stored reference.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h4><a name="rt_get">T &amp; get() const</a></h4>
<blockquote>
<p>
<b>Returns:</b> the stored reference.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h4><a name="rt_get_pointer">T* get_pointer() const</a></h4>
<blockquote>
<p>
<b>Returns:</b> a pointer to the stored object.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h3><a name="ref">ref</a></h3>
<pre>
template&lt;class T&gt; reference_wrapper&lt;T&gt; ref(T &amp; t);
</pre>
<blockquote>
<p>
<b>Returns:</b> <tt>reference_wrapper&lt;T&gt;(t)</tt>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h3><a name="cref">cref</a></h3>
<pre>
template&lt;class T&gt; reference_wrapper&lt;T const&gt; cref(T const &amp; t);
</pre>
<blockquote>
<p>
<b>Returns:</b> <tt>reference_wrapper&lt;T const&gt;(t)</tt>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h3><a name="is_reference_wrapper">is_reference_wrapper</a></h3>
<pre>
template&lt;class T&gt; class is_reference_wrapper&lt;T const&gt;
{
public:
static bool value = <i>unspecified</i>;
};
</pre>
Value is <b>true</b> iff <tt>T</tt> is a specialization of <tt>reference_wrapper</tt>.
<h3><a name="unwrap_reference">unwrap_reference</a></h3>
<pre>
template&lt;class T&gt; class unwrap_reference&lt;T const&gt;
{
public:
typedef <i>unspecified</i> type;
};
</pre>
<tt>type</tt> is equivalent to <tt>T::type</tt> if <tt>T</tt> is a
specialization of <tt>reference_wrapper</tt>. Otherwise <tt>type</tt> is
equivalent to <tt>T</tt>.
<h2>Acknowledgements</h2>
<p>
<b>ref</b> and <b>cref</b> were originally part of the Boost.Tuple library by <a href="../../people/jaakko_jarvi.htm">
Jaakko J&auml;rvi</a>. They were "promoted to <b>boost::</b> status" by <a href="../../people/peter_dimov.htm">
Peter Dimov</a> because they are generally useful. <a href="../../people/doug_gregor.html">
Douglas Gregor</a> and <a href="../../people/dave_abrahams.htm">Dave Abrahams</a>
contributed <tt>is_reference_wrapper</tt> and <tt>unwrap_reference</tt>.
</p>
<p><br>
<br>
<br>
<small>Copyright &copy; 2001 by Peter Dimov and Multi Media 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 &quot;as
is&quot; without express or implied warranty, and with no claim as to its
suitability for any purpose.</small></p>
</body>
<head>
<meta http-equiv="refresh" content="0; URL=../../doc/html/ref.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="../../doc/html/ref.html">../../doc/html/ref.html</a>
</body>
</html>

25
test/Jamfile Normal file
View File

@@ -0,0 +1,25 @@
# Boost.Bind Library test Jamfile
#
# Copyright (c) 2003 Peter Dimov
#
# Permission to copy, use, modify, sell and distribute this software
# is granted provided this copyright notice appears in all copies.
# This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
subproject libs/bind/test ;
# bring in rules for testing
import testing ;
# Make tests run by default.
DEPENDS all : bind ;
{
test-suite "bind"
: [ run bind_test.cpp ]
[ run mem_fn_test.cpp ]
[ run mem_fn_void_test.cpp ]
[ run mem_fn_derived_test.cpp ]
;
}

19
test/Jamfile.v2 Normal file
View File

@@ -0,0 +1,19 @@
# Boost.Bind Library test Jamfile
#
# Copyright (c) 2003 Peter Dimov
#
# Permission to copy, use, modify, sell and distribute this software
# is granted provided this copyright notice appears in all copies.
# This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
# bring in rules for testing
import testing ;
test-suite "bind"
: [ run bind_test.cpp ]
[ run mem_fn_test.cpp ]
[ run mem_fn_void_test.cpp ]
[ run mem_fn_derived_test.cpp ]
;

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL) && !defined(__COMO__)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion
@@ -190,12 +192,31 @@ void function_object_test()
#if !defined(__MWERKS__) || (__MWERKS__ > 0x2406) // Fails for this version of the compiler.
global_result = 0;
bind<void>(Y(), i, _1, 9, 4)(k);
BOOST_TEST( global_result == 4938 );
#endif
}
void function_object_test2()
{
using namespace boost;
short i(6);
int const k = 3;
BOOST_TEST( bind(type<short>(), Y(), ref(i))() == 7 );
BOOST_TEST( bind(type<short>(), Y(), ref(i))() == 8 );
BOOST_TEST( bind(type<int>(), Y(), i, _1)(k) == 38 );
BOOST_TEST( bind(type<long>(), Y(), i, _1, 9)(k) == 938 );
global_result = 0;
bind(type<void>(), Y(), i, _1, 9, 4)(k);
BOOST_TEST( global_result == 4938 );
}
//
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
@@ -487,6 +508,7 @@ int main()
{
function_test();
function_object_test();
function_object_test2();
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
adaptable_function_object_test();

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion

View File

@@ -1,4 +1,6 @@
#if defined(_MSC_VER) && !defined(__ICL)
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion