mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 00:26:44 -04:00
Use helper types
This commit is contained in:
parent
451bfe7a4b
commit
a74de9d64f
@ -40,12 +40,12 @@ void k_print(int64_t number);
|
||||
void k_printf(const char* fmt, ...);
|
||||
|
||||
template<typename... Arguments>
|
||||
typename std::enable_if<(sizeof...(Arguments) == 0), void>::type k_print_line(const Arguments&... args){
|
||||
typename std::enable_if_t<(sizeof...(Arguments) == 0)> k_print_line(const Arguments&... args){
|
||||
k_print('\n');
|
||||
}
|
||||
|
||||
template<typename... Arguments>
|
||||
typename std::enable_if<(sizeof...(Arguments) > 0), void>::type k_print_line(const Arguments&... args){
|
||||
typename std::enable_if_t<(sizeof...(Arguments) > 0)> k_print_line(const Arguments&... args){
|
||||
k_print(args...);
|
||||
k_print('\n');
|
||||
}
|
||||
|
@ -36,13 +36,13 @@ struct has_overloaded_addressof {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
constexpr typename std::disable_if<has_overloaded_addressof<T>::value, T*>::type
|
||||
constexpr typename std::disable_if_t<has_overloaded_addressof<T>::value, T*>
|
||||
static_addressof(T& ref){
|
||||
return &ref;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr typename std::enable_if<has_overloaded_addressof<T>::value, T*>::type
|
||||
constexpr typename std::enable_if_t<has_overloaded_addressof<T>::value, T*>
|
||||
static_addressof(T& ref){
|
||||
return std::addressof(ref);
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ template<typename T, typename Enable = void>
|
||||
struct add_rvalue_reference;
|
||||
|
||||
template<typename T>
|
||||
struct add_rvalue_reference<T, typename std::enable_if<std::is_reference<T>::value>::type> {
|
||||
struct add_rvalue_reference<T, typename std::enable_if_t<std::is_reference<T>::value>> {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct add_rvalue_reference<T, typename std::enable_if<!std::is_reference<T>::value>::type> {
|
||||
struct add_rvalue_reference<T, typename std::disable_if_t<!std::is_reference<T>::value>> {
|
||||
typedef T&& type;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user