Program Listing for File StaticAssert.h

Return to documentation for file (include/flamegpu/detail/StaticAssert.h)

#ifndef INCLUDE_FLAMEGPU_DETAIL_STATICASSERT_H_
#define INCLUDE_FLAMEGPU_DETAIL_STATICASSERT_H_

#include <cstdint>

namespace flamegpu {
namespace detail {
namespace StaticAssert {
template<class _Ty,
    _Ty _Val>
struct integral_constant {
    static constexpr _Ty value = _Val;

    typedef _Ty value_type;
    typedef integral_constant<_Ty, _Val> type;

    constexpr operator value_type() const noexcept {
        return (value);  // return stored value
    }

    constexpr value_type operator()() const noexcept {
        return (value);  // return stored value
    }
};
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
template<bool _Val>
struct _Cat_base
    : integral_constant<bool, _Val> {
};
template<class _Ty1,
    class _Ty2>
struct is_same
    : false_type { };
template<class _Ty1>
struct is_same<_Ty1, _Ty1>
    : true_type { };
template<class _Ty>
struct _Is_RealType
    : _Cat_base<is_same<_Ty, float>::value
    || is_same<_Ty, double>::value> {
};
template<class _Ty>
struct _Is_IntType
    : _Cat_base<is_same<_Ty, unsigned char>::value
    || is_same<_Ty, char>::value
    || is_same<_Ty, signed char>::value
    || is_same<_Ty, uint16_t>::value
    || is_same<_Ty, int16_t>::value
    || is_same<_Ty, uint32_t>::value
    || is_same<_Ty, int32_t>::value
    || is_same<_Ty, uint64_t>::value
    || is_same<_Ty, int64_t>::value> {
};
}  // namespace StaticAssert
}  // namespace detail
}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_DETAIL_STATICASSERT_H_