$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Alexander Gutenev (gutenev_at_[hidden])
Date: 2008-02-20 15:30:02
Hi
Is there any easy way to bind an explicit type conversion ?
For example, I want to supress compiler warning here with static_cast:
#include <boost/bind.hpp>
#include <boost/function.hpp>
int main(void)
{
boost::function<long (void)> foo;
boost::function<short (void)> bar;
bar = foo; // compiler warning.
bar = boost::bind<short>(foo); // the same warning
//bar = boost::bind(static_cast<short>, foo); // does not compile
return 0;
}
If not, I think it might be added. Casts are useful sometimes not only to
avoid warning, but also to get code compiled.