Re: what is meant by ?
- From: Jerry Coffin <jcoffin@xxxxxxxxx>
- Date: Thu, 14 Apr 2005 07:49:21 -0600
In article <#YYLaNNQFHA.1176@xxxxxxxxxxxxxxxxxxxx>,
fhickman_NOSP@xxxxxxxxxxxxxxx says...
[ ... ]
> >> int j= (int)some_class_that_implements_the_int_cast_operator;
> >
> > Well - you surely did not want that C-style cast there, did you?
[ ... ]
> Sure I did, how else would the example have been written? Or would using
> static_cast have pleased you more? ;)
A cast operator supports implicit casts, so this could be written as:
int j = some_class_that_implements_the_int_cast_operator;
Proxy classes use this behavior heavily. Nicely enough, it "uses up"
the one implicit cast allowed on any particular item, so any other
conversion must be explicit.
--
Later,
Jerry.
The universe is a figment of its own imagination.
.
- Follow-Ups:
- Re: what is meant by ?
- From: Frank Hickman [MVP]
- Re: what is meant by ?
- From: Simon Trew
- Re: what is meant by ?
- References:
- what is meant by ?
- From: IceColdFire
- Re: what is meant by ?
- From: Frank Hickman [MVP]
- Re: what is meant by ?
- From: Peter Koch Larsen
- Re: what is meant by ?
- From: Frank Hickman [MVP]
- what is meant by ?
- Prev by Date: Re: \x and strings
- Next by Date: Re: Redirection
- Previous by thread: Re: what is meant by ?
- Next by thread: Re: what is meant by ?
- Index(es):
Relevant Pages
|