Support Software for Vector Reduction/Transformation Operators Version of the Day
RTOpPack::Teuchos::ValueTypeConversionTraits< TypeTo, TypeFrom > Class Template Reference

Default traits class for all conversions of value types. More...

#include <RTOpPack_SPMD_apply_op_def.hpp>

List of all members.

Detailed Description

template<class TypeTo, class TypeFrom>
class RTOpPack::Teuchos::ValueTypeConversionTraits< TypeTo, TypeFrom >

Default traits class for all conversions of value types.

This class should never be called directly by clients. Instead, use the as() and asSafe() template functions.

This default traits class simply does an implicit type conversion. Therefore, any conversions that are built into the language and are safe do not need a traits class specialization and should not generate any compiler warnings. For example, the conversions float to double, short type to type, type to long type, and an enum value to int are all always value preserving and should never result in a compiler warning or any aberrant runtime behavior.

All other conversions that cause compiler warnings and/or could result in aberrant runtime behavior (e.g. type to and from unsigned type, to and from floating point and integral types, etc.), or do not have compiler defined conversions (e.g. std::string to int, double etc.) should be given specializations of this class template. If an unsafe or non-supported conversion is requested by a client (i.e. through as() or asSafe()) then this default traits class will be instantiated and the compiler will either generate a warning message (if the conversion is supported but is unsafe) or will not compile the code (if the conversion is not supported by default in C++). When this happens, a specialization can be added or the client code can be changed to avoid the conversion.

Definition at line 84 of file RTOpPack_SPMD_apply_op_def.hpp.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends