Use BSS default constructor
This commit is contained in:
@@ -2,6 +2,27 @@
|
||||
#define __JABYENGINE_TYPE_TRAITS_HPP__
|
||||
|
||||
namespace JabyEngine {
|
||||
template <class T, T v>
|
||||
struct integral_constant {
|
||||
static constexpr T value = v;
|
||||
|
||||
typedef T value_type;
|
||||
typedef integral_constant<T,v> type;
|
||||
|
||||
constexpr operator T() const {
|
||||
return v;
|
||||
}
|
||||
|
||||
constexpr T operator()() const {
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
||||
typedef integral_constant<bool, true> true_type;
|
||||
typedef integral_constant<bool, false> false_type;
|
||||
|
||||
// #############################################
|
||||
|
||||
template<bool B, class T = void>
|
||||
struct enable_if {};
|
||||
|
||||
@@ -53,6 +74,8 @@ namespace JabyEngine {
|
||||
|
||||
template<typename T, typename... Ts>
|
||||
using variadic_force_same = enable_if<conjunction<is_same<T, Ts>...>::value>::type;
|
||||
|
||||
// #############################################
|
||||
}
|
||||
|
||||
#endif //! __JABYENGINE_TYPE_TRAITS_HPP__
|
Reference in New Issue
Block a user