Global Functions in Namespace sal
in Sourcefile types.h
- static_int_cast
template< typename T1, typename T2 >
T1 static_int_cast(
-
virtual |
abstract |
const |
volatile |
template |
static |
inline |
C-linkage |
NO |
NO |
NO |
NO |
YES |
NO |
YES |
NO |
- Summary
A static_cast between integral types, to avoid C++ compiler warnings.
- Description
In C++ source code, use sal::static_int_cast<T>(n) instead of
static_cast<T>(n) whenever a compiler warning about integral type problems
shall be silenced. That way, source code that needs to be modified when the
type of any of the expressions involved in the compiler warning is changed
can be found more easily.
Both template arguments T1 and T2 must be integral types.
Top of Page
Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.