Make Boost.Function's target() operation respect the cv-qualifiers of referenced function objects. Fixes #736

[SVN r48618]
This commit is contained in:
Douglas Gregor
2008-09-05 17:52:12 +00:00
parent ea18f5777b
commit f379ef8532
4 changed files with 98 additions and 36 deletions

View File

@ -88,6 +88,15 @@ static void target_test()
BOOST_CHECK(!f.target<int (*)()>());
BOOST_CHECK(f.target<Seventeen>());
BOOST_CHECK(f.target<Seventeen>() == &this_seventeen);
const Seventeen const_seventeen = this_seventeen;
f = boost::ref(const_seventeen);
BOOST_CHECK(!f.target<int (*)()>());
BOOST_CHECK(f.target<const Seventeen>());
BOOST_CHECK(f.target<const Seventeen>() == &const_seventeen);
BOOST_CHECK(f.target<const volatile Seventeen>());
BOOST_CHECK(!f.target<Seventeen>());
BOOST_CHECK(!f.target<volatile Seventeen>());
}
static void equal_test()