mirror of
https://github.com/g-truc/glm.git
synced 2025-04-07 22:40:17 +00:00
Added float_or_int_trait
This commit is contained in:
parent
70efce771d
commit
620861973e
1 changed files with 85 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue