CommonType.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPETRAITS_COMMONTYPE_H_
36 #define _BLAZE_UTIL_TYPETRAITS_COMMONTYPE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <boost/type_traits/common_type.hpp>
44 #include <blaze/util/NullType.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
69 template< typename T1, typename T2, typename T3 = NullType >
70 struct CommonType
71 {
72  public:
73  //**********************************************************************************************
75  typedef typename boost::common_type<T1,T2,T3>::type Type;
77  //**********************************************************************************************
78 };
79 //*************************************************************************************************
80 
81 
82 //*************************************************************************************************
84 template< typename T1, typename T2 >
86 struct CommonType<T1,T2,NullType>
87 {
88  public:
89  //**********************************************************************************************
90  typedef typename boost::common_type<T1,T2>::type Type;
91  //**********************************************************************************************
92 };
94 //*************************************************************************************************
95 
96 } // namespace blaze
97 
98 #endif
Utility type for generic codes.
Deduction of a type common to several types.The CommonType type trait deduces a type that is common t...
Definition: CommonType.h:70
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Utility type for generic codes.The NullType class represents an invalid or terminating data type for ...
Definition: NullType.h:54