Boost logo

Boost :

From: John E. Potter (jpotter_at_[hidden])
Date: 2000-02-08 06:02:39


On Tue, 8 Feb 2000, Gavin Collings wrote:

> There is a good reason for its existance. As I remember, it was based
> on an example in C++PL (3rd Ed) whereby it is sometimes useful to
> explicitly evoke an implicit type conversion from the compiler, for
> example to direct template argument deduction. I would contend that
> explicit_cast<>() would be a better name for that.

The point of the name was that only implicit conversions could be
performed. Derived --> Base, yes; Base --> Derived, no. Explicit_cast
is the name for the group of standard casts. Static_cast can do
anything that implicit_cast can do, but not conversly. Unlike
static_cast, it is known to be safe.

John


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk