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

@ -516,11 +516,9 @@ namespace boost {
function_buffer& functor, function_obj_ref_tag)
{
if (!boost::detail::function::has_empty_target(f.get_pointer())) {
// DPG TBD: We might need to detect constness of
// FunctionObj to assign into obj_ptr or const_obj_ptr to
// be truly legit, but no platform in existence makes
// const void* different from void*.
functor.const_obj_ptr = f.get_pointer();
functor.obj_ref.obj_ptr = (void *)f.get_pointer();
functor.obj_ref.is_const = is_const<FunctionObj>::value;
functor.obj_ref.is_volatile = is_volatile<FunctionObj>::value;
return true;
} else {
return false;