Chapter Contents |
Previous |
Next |
SAS/C C++ Development System User's Guide, Release 6.50 |
This release of the C++
translator supports several new cast operators. These operators are defined
in the ISO C++ draft as improved alternatives to the old cast operators, for
example,
(type)(expr)
or
type_name (expr)
. For more
information on these operators, see Stroustrup's Design and Evolution
of C++.
The new cast operators are
static_cast< type > ( expr ) |
const_cast< type > ( expr ) |
reinterpret_cast< type > ( expr ) |
dynamic_cast< type > ( expr ) |
The new cast operators, except
dynamic_cast
, provide separate components of the functionality of
the old casts that allow improved type checking. Any old-style cast can be
expressed as a combination of the new casts. The new cast operators, other
than
const_cast
, are not
allowed to cast away constness on pointer, pointer to member, and reference
conversions. See section 5.2.11 of the ISO draft for more
information.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © Tue Feb 10 12:11:23 EST 1998 by SAS Institute Inc., Cary, NC, USA. All rights reserved.