mirror of
https://github.com/boostorg/function.git
synced 2025-06-26 12:31:33 +02:00
Compare commits
5 Commits
svn-branch
...
boost-1.28
Author | SHA1 | Date | |
---|---|---|---|
93e507526a | |||
0dcec9ffb9 | |||
4d635501ab | |||
d1f21800ac | |||
092cb0d706 |
@ -96,7 +96,7 @@ object. This is often referred to as "argument binding", and is beyond the scope
|
|||||||
|
|
||||||
f(5); // Call x.foo(5)</pre></li>
|
f(5); // Call x.foo(5)</pre></li>
|
||||||
|
|
||||||
<li><a href="http://lambda.cs.utu.fi/">The Lambda library</a>. This library provides a powerful composition mechanism to construct function objects that uses very natural C++ syntax. Lambda requires a compiler that is reasonably conformant to the C++ standard. Note that it is not a Boost library.</li>
|
<li><a href="../../lambda/doc/index.html">The Boost.Lambda library</a>. This library provides a powerful composition mechanism to construct function objects that uses very natural C++ syntax. Lambda requires a compiler that is reasonably conformant to the C++ standard. </li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>References to Functions</h3>
|
<h3>References to Functions</h3>
|
||||||
@ -199,7 +199,7 @@ boost::function2<float, int, int, SynchronizedPolicy, SynchronizedMixin> f
|
|||||||
<address><a href="mailto:gregod@cs.rpi.edu">Douglas Gregor</a></address>
|
<address><a href="mailto:gregod@cs.rpi.edu">Douglas Gregor</a></address>
|
||||||
<!-- Created: Fri Jul 13 12:47:11 EDT 2001 -->
|
<!-- Created: Fri Jul 13 12:47:11 EDT 2001 -->
|
||||||
<!-- hhmts start -->
|
<!-- hhmts start -->
|
||||||
Last modified: Fri Dec 14 19:58:14 EST 2001
|
Last modified: Mon May 13 08:31:23 EDT 2002
|
||||||
<!-- hhmts end -->
|
<!-- hhmts end -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -307,13 +307,13 @@ namespace boost {
|
|||||||
public: // should be protected, but GCC 2.95.3 will fail to allow access
|
public: // should be protected, but GCC 2.95.3 will fail to allow access
|
||||||
detail::function::any_pointer (*manager)(
|
detail::function::any_pointer (*manager)(
|
||||||
detail::function::any_pointer,
|
detail::function::any_pointer,
|
||||||
|
detail::function::functor_manager_operation_type);
|
||||||
|
detail::function::any_pointer functor;
|
||||||
|
|
||||||
#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
|
#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
|
||||||
// Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
|
// Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
|
||||||
operator bool () const { return !this->empty(); }
|
operator bool () const { return !this->empty(); }
|
||||||
#else
|
#else
|
||||||
detail::function::functor_manager_operation_type);
|
|
||||||
detail::function::any_pointer functor;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct dummy {
|
struct dummy {
|
||||||
void nonnull() {};
|
void nonnull() {};
|
||||||
@ -324,10 +324,10 @@ namespace boost {
|
|||||||
public:
|
public:
|
||||||
operator safe_bool () const
|
operator safe_bool () const
|
||||||
{ return (this->empty())? 0 : &dummy::nonnull; }
|
{ return (this->empty())? 0 : &dummy::nonnull; }
|
||||||
#endif
|
|
||||||
|
|
||||||
safe_bool operator!() const
|
safe_bool operator!() const
|
||||||
{ return (this->empty())? &dummy::nonnull : 0; }
|
{ return (this->empty())? &dummy::nonnull : 0; }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Poison comparison between Boost.Function objects (because it is
|
/* Poison comparison between Boost.Function objects (because it is
|
||||||
@ -341,20 +341,14 @@ namespace boost {
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace function {
|
namespace function {
|
||||||
// The result is not a Boost.Function object, so we assume that this
|
inline bool has_empty_target(const function_base* f)
|
||||||
// target is not empty
|
|
||||||
template<typename FunctionObj>
|
|
||||||
inline bool has_empty_target(const FunctionObj&, truth<false>)
|
|
||||||
{
|
{
|
||||||
return false;
|
return f->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The result is a Boost.Function object, so query whether it is empty
|
inline bool has_empty_target(...)
|
||||||
// or not
|
|
||||||
template<typename FunctionObj>
|
|
||||||
inline bool has_empty_target(const FunctionObj& f, truth<true>)
|
|
||||||
{
|
{
|
||||||
return f.empty();
|
return false;
|
||||||
}
|
}
|
||||||
} // end namespace function
|
} // end namespace function
|
||||||
} // end namespace detail
|
} // end namespace detail
|
||||||
|
@ -425,11 +425,7 @@ namespace boost {
|
|||||||
template<typename FunctionObj>
|
template<typename FunctionObj>
|
||||||
void assign_to(FunctionObj f, detail::function::function_obj_tag)
|
void assign_to(FunctionObj f, detail::function::function_obj_tag)
|
||||||
{
|
{
|
||||||
typedef detail::function::truth<
|
if (!detail::function::has_empty_target(addressof(f))) {
|
||||||
boost::is_base_and_derived<function_base, FunctionObj>::value>
|
|
||||||
is_boost_function;
|
|
||||||
|
|
||||||
if (!detail::function::has_empty_target(f, is_boost_function())) {
|
|
||||||
typedef
|
typedef
|
||||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||||
FunctionObj,
|
FunctionObj,
|
||||||
@ -463,11 +459,7 @@ namespace boost {
|
|||||||
void assign_to(const reference_wrapper<FunctionObj>& f,
|
void assign_to(const reference_wrapper<FunctionObj>& f,
|
||||||
detail::function::function_obj_ref_tag)
|
detail::function::function_obj_ref_tag)
|
||||||
{
|
{
|
||||||
typedef detail::function::truth<
|
if (!detail::function::has_empty_target(f.get_pointer())) {
|
||||||
boost::is_base_and_derived<function_base, FunctionObj>::value>
|
|
||||||
is_boost_function;
|
|
||||||
|
|
||||||
if (!detail::function::has_empty_target(f.get(), is_boost_function())) {
|
|
||||||
typedef
|
typedef
|
||||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||||
FunctionObj,
|
FunctionObj,
|
||||||
|
Reference in New Issue
Block a user