Compare commits

..

9 Commits

Author SHA1 Message Date
Ronald Garcia
687dff0782 Created a branch from trunk
[SVN r38959]
2007-08-26 05:34:35 +00:00
Douglas Gregor
80a3f47099 Committed patch to eliminate warnings with GCC's -Wundef. Fixes #1197
[SVN r38827]
2007-08-21 15:35:19 +00:00
Vladimir Prus
2a85edbd31 Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
Douglas Gregor
5c514ebe35 Try to work around EC++4 bug
[SVN r37471]
2007-04-18 12:13:53 +00:00
Beman Dawes
6a3f0df553 Add copyright, license
[SVN r35905]
2006-11-07 19:11:57 +00:00
Douglas Gregor
64c8d10fa8 Eliminate MSVC 8.0 warning
[SVN r35588]
2006-10-13 14:29:56 +00:00
Peter Dimov
a2a810d2c1 Put back #include <functional> in case functionN.hpp is used directly
[SVN r34519]
2006-07-12 22:12:01 +00:00
Peter Dimov
d84481361f TR1 cyclic dependency fixes.
[SVN r34499]
2006-07-10 13:17:41 +00:00
Peter Dimov
872f12efee TR1 conformance: derive from unary_function/binary_function
[SVN r34481]
2006-07-08 18:07:33 +00:00
12 changed files with 33 additions and 83 deletions

View File

@@ -1,8 +1,3 @@
# Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
# 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)
project boost/doc ; project boost/doc ;
import boostbook : boostbook ; import boostbook : boostbook ;

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<section id="function.faq" last-revision="$Date$"> <section id="function.faq" last-revision="$Date$">

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<section id="function.history" last-revision="$Date$"> <section id="function.history" last-revision="$Date$">

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<section id="function.misc" last-revision="$Date$"> <section id="function.misc" last-revision="$Date$">

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<testsuite id="function.testsuite" last-revision="$Date$"> <testsuite id="function.testsuite" last-revision="$Date$">

View File

@@ -1,11 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<section xmlns:xi="http://www.w3.org/2001/XInclude" id="function.tutorial" <section xmlns:xi="http://www.w3.org/2001/XInclude" id="function.tutorial"

View File

@@ -10,6 +10,8 @@
// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the // William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
// design of this library. // design of this library.
#include <functional> // unary_function, binary_function
#include <boost/preprocessor/iterate.hpp> #include <boost/preprocessor/iterate.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>

View File

@@ -11,6 +11,7 @@
#define BOOST_FUNCTION_PROLOGUE_HPP #define BOOST_FUNCTION_PROLOGUE_HPP
# include <cassert> # include <cassert>
# include <algorithm> # include <algorithm>
# include <functional> // unary_function, binary_function
# include <boost/throw_exception.hpp> # include <boost/throw_exception.hpp>
# include <boost/config.hpp> # include <boost/config.hpp>
# include <boost/function/function_base.hpp> # include <boost/function/function_base.hpp>

View File

@@ -30,6 +30,14 @@
#endif #endif
#include <boost/function_equal.hpp> #include <boost/function_equal.hpp>
// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
#ifdef BOOST_NO_EXCEPTION_STD_NAMESPACE
// Embedded VC++ does not have type_info in namespace std
# define BOOST_FUNCTION_STD_NS
#else
# define BOOST_FUNCTION_STD_NS std
#endif
// Borrowed from Boost.Python library: determines the cases where we // Borrowed from Boost.Python library: determines the cases where we
// need to use std::type_info::name to compare instead of operator==. // need to use std::type_info::name to compare instead of operator==.
# if (defined(__GNUC__) && __GNUC__ >= 3) \ # if (defined(__GNUC__) && __GNUC__ >= 3) \
@@ -59,7 +67,7 @@ namespace boost { namespace python { namespace objects {
#if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ #if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|| defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ || defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
|| !(BOOST_STRICT_CONFIG || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX # define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
#endif #endif
@@ -215,8 +223,8 @@ namespace boost {
// DPG TBD: Since we're only storing a pointer, it's // DPG TBD: Since we're only storing a pointer, it's
// possible that the user could ask for a base class or // possible that the user could ask for a base class or
// derived class. Is that okay? // derived class. Is that okay?
const std::type_info& check_type = const BOOST_FUNCTION_STD_NS::type_info& check_type =
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr); *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(F))) if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(F)))
out_buffer.obj_ptr = in_buffer.obj_ptr; out_buffer.obj_ptr = in_buffer.obj_ptr;
else else
@@ -265,8 +273,8 @@ namespace boost {
else if (op == destroy_functor_tag) else if (op == destroy_functor_tag)
out_buffer.func_ptr = 0; out_buffer.func_ptr = 0;
else /* op == check_functor_type_tag */ { else /* op == check_functor_type_tag */ {
const std::type_info& check_type = const BOOST_FUNCTION_STD_NS::type_info& check_type =
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr); *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
out_buffer.obj_ptr = &in_buffer.func_ptr; out_buffer.obj_ptr = &in_buffer.func_ptr;
else else
@@ -287,8 +295,8 @@ namespace boost {
// Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor(); reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
} else /* op == check_functor_type_tag */ { } else /* op == check_functor_type_tag */ {
const std::type_info& check_type = const BOOST_FUNCTION_STD_NS::type_info& check_type =
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr); *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
out_buffer.obj_ptr = &in_buffer.data; out_buffer.obj_ptr = &in_buffer.data;
else else
@@ -348,8 +356,8 @@ namespace boost {
# endif // BOOST_NO_STD_ALLOCATOR # endif // BOOST_NO_STD_ALLOCATOR
out_buffer.obj_ptr = 0; out_buffer.obj_ptr = 0;
} else /* op == check_functor_type_tag */ { } else /* op == check_functor_type_tag */ {
const std::type_info& check_type = const BOOST_FUNCTION_STD_NS::type_info& check_type =
*static_cast<const std::type_info*>(out_buffer.const_obj_ptr); *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
out_buffer.obj_ptr = in_buffer.obj_ptr; out_buffer.obj_ptr = in_buffer.obj_ptr;
else else
@@ -480,13 +488,13 @@ public:
/** Retrieve the type of the stored function object, or typeid(void) /** Retrieve the type of the stored function object, or typeid(void)
if this is empty. */ if this is empty. */
const std::type_info& target_type() const const BOOST_FUNCTION_STD_NS::type_info& target_type() const
{ {
if (!vtable) return typeid(void); if (!vtable) return typeid(void);
detail::function::function_buffer type; detail::function::function_buffer type;
vtable->manager(functor, type, detail::function::get_functor_type_tag); vtable->manager(functor, type, detail::function::get_functor_type_tag);
return *static_cast<const std::type_info*>(type.const_obj_ptr); return *static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(type.const_obj_ptr);
} }
template<typename Functor> template<typename Functor>

View File

@@ -70,16 +70,6 @@
# define BOOST_FUNCTION_RETURN(X) X; return BOOST_FUNCTION_VOID_RETURN_TYPE () # define BOOST_FUNCTION_RETURN(X) X; return BOOST_FUNCTION_VOID_RETURN_TYPE ()
#endif #endif
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant.
#endif
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4127) // conditional expression is constant.
#endif
namespace boost { namespace boost {
namespace detail { namespace detail {
namespace function { namespace function {
@@ -456,6 +446,17 @@ namespace boost {
typename Allocator = BOOST_FUNCTION_DEFAULT_ALLOCATOR typename Allocator = BOOST_FUNCTION_DEFAULT_ALLOCATOR
> >
class BOOST_FUNCTION_FUNCTION : public function_base class BOOST_FUNCTION_FUNCTION : public function_base
#if BOOST_FUNCTION_NUM_ARGS == 1
, public std::unary_function<T0,R>
#elif BOOST_FUNCTION_NUM_ARGS == 2
, public std::binary_function<T0,T1,R>
#endif
{ {
public: public:
#ifndef BOOST_NO_VOID_RETURNS #ifndef BOOST_NO_VOID_RETURNS
@@ -798,19 +799,11 @@ public:
} }
}; };
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#undef BOOST_FUNCTION_PARTIAL_SPEC #undef BOOST_FUNCTION_PARTIAL_SPEC
#endif // have partial specialization #endif // have partial specialization
} // end namespace boost } // end namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
// Cleanup after ourselves... // Cleanup after ourselves...
#undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_VTABLE
#undef BOOST_FUNCTION_DEFAULT_ALLOCATOR #undef BOOST_FUNCTION_DEFAULT_ALLOCATOR

View File

@@ -1,11 +1,4 @@
<html> <html>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
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)
-->
<head> <head>
<meta http-equiv="refresh" content="0; URL=../../doc/html/function.html"> <meta http-equiv="refresh" content="0; URL=../../doc/html/function.html">
</head> </head>