Added contains() and function_equal()

[SVN r22483]
This commit is contained in:
Douglas Gregor
2004-03-12 03:38:20 +00:00
parent e80a00545c
commit 2c0e633307
5 changed files with 111 additions and 15 deletions

View File

@ -648,7 +648,8 @@ template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
Allocator>& f,
Functor g)
{
if (const Functor* fp = f.template target<Functor>()) return *fp == g;
if (const Functor* fp = f.template target<Functor>())
return function_equal(*fp, g);
else return false;
}
@ -661,7 +662,8 @@ template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
BOOST_FUNCTION_TEMPLATE_ARGS ,
Allocator>& f)
{
if (const Functor* fp = f.template target<Functor>()) return g == *fp;
if (const Functor* fp = f.template target<Functor>())
return function_equal(g, *fp);
else return false;
}
@ -674,7 +676,8 @@ template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
Allocator>& f,
Functor g)
{
if (const Functor* fp = f.template target<Functor>()) return *fp != g;
if (const Functor* fp = f.template target<Functor>())
return !function_equal(*fp, g);
else return true;
}
@ -687,7 +690,8 @@ template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
BOOST_FUNCTION_TEMPLATE_ARGS ,
Allocator>& f)
{
if (const Functor* fp = f.template target<Functor>()) return g != *fp;
if (const Functor* fp = f.template target<Functor>())
return !function_equal(g, *fp);
else return true;
}