Added float_or_int_trait

This commit is contained in:
Christophe Riccio 2011-10-13 18:42:45 +01:00
parent 70efce771d
commit 620861973e

View File

@ -345,8 +345,92 @@ namespace detail
typedef float float32;
typedef double float64;
}//namespace detail
//////////////////
// float_or_int_trait
struct float_or_int_value
{
enum
{
ERROR,
FLOAT,
INT
};
};
template <typename T>
struct float_or_int_trait
{
enum{ID = float_or_int_value::ERROR};
};
template <>
struct float_or_int_trait<int8>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<int16>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<int32>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<int64>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<uint8>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<uint16>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<uint32>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<uint64>
{
enum{ID = float_or_int_value::INT};
};
template <>
struct float_or_int_trait<float16>
{
enum{ID = float_or_int_value::FLOAT};
};
template <>
struct float_or_int_trait<float32>
{
enum{ID = float_or_int_value::FLOAT};
};
template <>
struct float_or_int_trait<float64>
{
enum{ID = float_or_int_value::FLOAT};
};
}//namespace detail
}//namespace glm
#if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))