Boost logo

Boost Users :

From: Sean Huang (huangsean_at_[hidden])
Date: 2006-07-19 21:09:57


----- Original Message -----
From: "Sebastian Redl" <sebastian.redl_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Wednesday, July 19, 2006 6:41 PM
Subject: Re: [Boost-users] [function]unwanted conversion

> Sean Huang wrote:
>
>>Is there any reason why boost::function allows such conversions?
>>
>>
> Boost.Function tries to behave as if it were a function pointer. And
> like all pointers, function pointers can be assigned an integral
> constant with the value 0, resulting in a null pointer. Thus, you can
> assign 0 and char() to a Boost.Function.
>
Now I see as long as boost::function allows assignment (or copy
construction) from a function pointer, this conversion is always valid.

Thanks,

Sean


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net