home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mole-end!mat
- From: mat@mole-end.matawan.nj.us
- Subject: Re: Type-cast to void
- Message-ID: <1993Jan25.012051.13911@mole-end.matawan.nj.us>
- Summary: function-style cast is `value builder' is necessary!
- Organization: :
- References: <1993Jan17.143532.15949@mnemosyne.cs.du.edu> <dak.727311054@hathi> <898@ulogic.UUCP>
- Date: Mon, 25 Jan 1993 01:20:51 GMT
- Lines: 36
-
- In article <898@ulogic.UUCP>, hartman@ulogic.UUCP (Richard M. Hartman) writes:
- > In article <dak.727311054@hathi> dak@hathi.informatik.rwth-aachen.de (David Kastrup) writes:
- > >grimmer@nyx.cs.du.edu (Geoff Rimmer) writes:
-
- > >In my opinion, function
- > >style casts were a mistake from the beginning. They ambiguate code,
- > >gain nothing, and typedefs, constructors and functions form an amorph
- > >mishmash.
-
- > I do not know if this is a legitimate statement
- > x = (X) i;
- > which *would* have been the way to write a cast if we did not
- > use the constructors instead. ...
-
- Yes, it is. The symmetry, while not perfect, is strong.
-
- > use the constructors instead. The functional syntax of casting:
- > i = int(x);
- > is merely for symmetry with the class constructors. I think that
- > a constructor is NOT a cast, and this is a false symmetry. And
- > that the idea of functional style of casting should have been
- > strangled in the cradle!
-
- There's another important use, the `constructor-as-expression,' for
- which someone long ago coined the unofficial term `value builder':
-
- const Point origin( 0.0, 0.0 );
- Rectangle working_extent = exent.intersection(
- Rectangle( origin, z.ne() ) );
-
- This looks clumsy, but try to write the equivalent code otherwise!
- --
- (This man's opinions are his own.)
- From mole-end Mark Terribile
-
- mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
-