mirror of
https://github.com/boostorg/function.git
synced 2025-06-26 20:41:32 +02:00
Compare commits
9 Commits
svn-branch
...
boost-1.34
Author | SHA1 | Date | |
---|---|---|---|
1b60e82b2f | |||
7581949360 | |||
0b2aeda226 | |||
2ecd62c612 | |||
47033bd162 | |||
c7d5016022 | |||
d92355cca2 | |||
0123f84bff | |||
0207da8008 |
@ -1,3 +1,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)
|
||||||
project boost/doc ;
|
project boost/doc ;
|
||||||
import boostbook : boostbook ;
|
import boostbook : boostbook ;
|
||||||
|
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?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$">
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?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$">
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?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$">
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?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">
|
||||||
|
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?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$">
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<?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"
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
// 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>
|
||||||
|
|
||||||
@ -23,8 +21,8 @@
|
|||||||
// in anything that may be included by function_template.hpp doesn't break
|
// in anything that may be included by function_template.hpp doesn't break
|
||||||
#include <boost/function/detail/prologue.hpp>
|
#include <boost/function/detail/prologue.hpp>
|
||||||
|
|
||||||
// Visual Age C++ doesn't handle the file iteration well
|
// Older versions of the IBM C++ compiler do not handle file iterations well
|
||||||
#if BOOST_WORKAROUND(__IBMCPP__, >= 500)
|
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
|
||||||
# if BOOST_FUNCTION_MAX_ARGS >= 0
|
# if BOOST_FUNCTION_MAX_ARGS >= 0
|
||||||
# include <boost/function/function0.hpp>
|
# include <boost/function/function0.hpp>
|
||||||
# endif
|
# endif
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#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>
|
||||||
|
@ -30,14 +30,6 @@
|
|||||||
#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) \
|
||||||
@ -67,7 +59,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) \
|
||||||
|| !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
|
|| !(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
|
||||||
|
|
||||||
@ -223,8 +215,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 BOOST_FUNCTION_STD_NS::type_info& check_type =
|
const std::type_info& check_type =
|
||||||
*static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
|
*static_cast<const std::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
|
||||||
@ -273,8 +265,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 BOOST_FUNCTION_STD_NS::type_info& check_type =
|
const std::type_info& check_type =
|
||||||
*static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
|
*static_cast<const std::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
|
||||||
@ -295,8 +287,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 BOOST_FUNCTION_STD_NS::type_info& check_type =
|
const std::type_info& check_type =
|
||||||
*static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
|
*static_cast<const std::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
|
||||||
@ -356,8 +348,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 BOOST_FUNCTION_STD_NS::type_info& check_type =
|
const std::type_info& check_type =
|
||||||
*static_cast<const BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
|
*static_cast<const std::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
|
||||||
@ -488,13 +480,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 BOOST_FUNCTION_STD_NS::type_info& target_type() const
|
const std::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 BOOST_FUNCTION_STD_NS::type_info*>(type.const_obj_ptr);
|
return *static_cast<const std::type_info*>(type.const_obj_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
|
@ -70,6 +70,16 @@
|
|||||||
# 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 {
|
||||||
@ -446,17 +456,6 @@ 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
|
||||||
@ -799,11 +798,19 @@ 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
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
<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>
|
||||||
|
Reference in New Issue
Block a user