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 © 2012, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.