Warning fix on latest gcc

This commit is contained in:
King_DuckZ 2022-06-06 12:03:11 +02:00
parent fcaa62d69f
commit 08a2b58510

View file

@ -28,6 +28,8 @@ namespace vwr {
template <typename V>
struct VectorWrapperInfo;
typedef decltype(sizeof(int)) vwr_size_t;
template <typename V, size_type S=VectorWrapperInfo<V>::dimensions>
class Vec;
@ -62,29 +64,27 @@ namespace vwr {
template <typename T, size_type I> struct get_offset_enum_from_index;
template <typename T> struct get_offset_enum_from_index<T, 0> {
enum { value = VectorWrapperInfo<T>::offset_x };
static constexpr vwr_size_t value = VectorWrapperInfo<T>::offset_x;
};
template <typename T> struct get_offset_enum_from_index<T, 1> {
enum { value = VectorWrapperInfo<T>::offset_y };
static constexpr vwr_size_t value = VectorWrapperInfo<T>::offset_y;
};
template <typename T> struct get_offset_enum_from_index<T, 2> {
enum { value = VectorWrapperInfo<T>::offset_z };
static constexpr vwr_size_t value = VectorWrapperInfo<T>::offset_z;
};
template <typename T> struct get_offset_enum_from_index<T, 3> {
enum { value = VectorWrapperInfo<T>::offset_w };
static constexpr vwr_size_t value = VectorWrapperInfo<T>::offset_w;
};
template <typename T, size_type S=VectorWrapperInfo<T>::dimensions> struct min_offset {
enum {
value = (
static constexpr vwr_size_t value = (
static_cast<int>(get_offset_enum_from_index<T, S-1>::value) < static_cast<int>(min_offset<T, S-1>::value) ?
static_cast<int>(get_offset_enum_from_index<T, S-1>::value) :
static_cast<int>(min_offset<T, S-1>::value)
)
};
);
};
template <typename T> struct min_offset<T, 1> {
enum { value = get_offset_enum_from_index<T, 0>::value };
static constexpr vwr_size_t value = get_offset_enum_from_index<T, 0>::value;
};
} //namespace implem
} //namespace vwr