simplify template code like std::invoke_result<T>::type

This commit is contained in:
oltolm 2024-03-20 17:28:59 +01:00 committed by Elad Ashkenazi
parent 9e9a3262eb
commit 862727e9bf
6 changed files with 6 additions and 5 deletions

View file

@ -13,7 +13,7 @@ struct bf_base
{
using type = T;
using vtype = std::common_type_t<type>;
using utype = typename std::make_unsigned<vtype>::type;
using utype = std::make_unsigned_t<vtype>;
static constexpr bool can_be_packed = N < (sizeof(int) * 8 + (std::is_unsigned_v<vtype> ? 1 : 0)) && sizeof(vtype) > sizeof(int);
using compact_type = std::conditional_t<can_be_packed, std::conditional_t<std::is_unsigned_v<vtype>, uint, int>, vtype>;

View file

@ -410,7 +410,7 @@ namespace rsx
std::sort(begin(), end(), predicate);
}
template <typename F, typename U = std::invoke_result<F, const Ty&>::type>
template <typename F, typename U = std::invoke_result_t<F, const Ty&>>
requires std::is_invocable_v<F, const Ty&>
simple_array<U> map(F&& xform) const
{

View file

@ -149,7 +149,7 @@ namespace rsx
rsx::address_range memory_range;
std::unique_ptr<typename std::remove_pointer<image_storage_type>::type> resolve_surface;
std::unique_ptr<typename std::remove_pointer_t<image_storage_type>> resolve_surface;
surface_sample_layout sample_layout = surface_sample_layout::null;
surface_raster_type raster_type = surface_raster_type::linear;

View file

@ -1,5 +1,6 @@
#pragma once
#include "Emu/RSX/GL/GLTexture.h"
#include "GLRenderTargets.h"
#include "glutils/blitter.h"
#include "glutils/sync.hpp"

View file

@ -1167,7 +1167,7 @@ template <typename T, usz Align = sizeof(T)>
class atomic_t
{
protected:
using type = typename std::remove_cv<T>::type;
using type = std::remove_cv_t<T>;
using ptr_rt = std::conditional_t<std::is_pointer_v<type>, ullong, type>;

View file

@ -148,7 +148,7 @@ namespace stx
template <typename T, bool Swap, usz Align = alignof(T)>
class alignas(Align) se_t
{
using type = typename std::remove_cv<T>::type;
using type = std::remove_cv_t<T>;
using stype = typename se_storage<type, Align>::type;
using storage = se_storage<type, Align>;