Use BSS default constructor

This commit is contained in:
2023-06-21 21:45:15 +02:00
parent 50a2fc3128
commit 3be39c410b
7 changed files with 160 additions and 161 deletions

View File

@@ -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__