[interfacekit] Re: oddish?
- From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
- To: Interface Kit Team <interfacekit@xxxxxxxxxxxxx>
- Date: Mon, 16 Feb 2004 12:07:21 +0100 (MET)
On Mon, 16 Feb 2004, Adi Oanca wrote:
> Have another question for you guys.
>
> class Layer
> {
> public:
> [...]
> void Invalidate(const BRegion ®ion);
> [...]
> }
>
> int main()
> {
> [...]
> lay->Invalidate(BRect(225,10,350,400));//BRegion(lay->Bounds()));
> [...]
> }
>
>
> Why is this working? Why is there no compiler error?
>
> Does it have something to do with the fact that one BRegion constructor
> is declared like this:
>
> BRegion(const BRect rect);
>
> ?
Yep, that's exactly the reason. It's a nice C++ feature. If undesired, one
can disable it by marking the constructor with the modifier `explicit'.
CU, Ingo
- Follow-Ups:
- [interfacekit] Re: oddish?
- From: Andrew Bachmann
- References:
- [interfacekit] oddish?
- From: Adi Oanca
Other related posts:
- » [interfacekit] oddish?
- » [interfacekit] Re: oddish?
- » [interfacekit] Re: oddish?
- » [interfacekit] Re: oddish?
- » [interfacekit] Re: oddish?
- » [interfacekit] Re: oddish?
- » [interfacekit] Re: oddish?
- [interfacekit] Re: oddish?
- From: Andrew Bachmann
- [interfacekit] oddish?
- From: Adi Oanca