Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_implicit_cast.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_IMPLICIT_CAST_HPP
11 #define TEUCHOS_IMPLICIT_CAST_HPP
12 
13 #include "Teuchos_ConfigDefs.hpp"
14 
15 namespace Teuchos {
16 
48 template<class TypeTo, class TypeFrom>
49 inline TypeTo implicit_cast( const TypeFrom& t ) { return t; }
50 
83 template<class TypeTo, class TypeFrom>
84 inline TypeTo& implicit_ref_cast( TypeFrom& t ) { return t; }
85 
117 template<class TypeTo, class TypeFrom>
118 inline TypeTo* implicit_ptr_cast( TypeFrom* t ) { return t; }
119 
120 } // end namespace Teuchos
121 
122 #endif // TEUCHOS_IMPLICIT_CAST_HPP
TypeTo & implicit_ref_cast(TypeFrom &t)
Perform an implicit cast of reference types with a reference being returned.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
TypeTo implicit_cast(const TypeFrom &t)
Perform an implicit cast of concrete types with the casted object returned by value.
TypeTo * implicit_ptr_cast(TypeFrom *t)
Perform an implicit cast of pointer types with a pointer being returned.