Skip to content

Commit fd866e0

Browse files
we have C++17 now, lets use it
1 parent 758b1e6 commit fd866e0

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

include/CObjectCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace impl
113113
// typedefs for implementation only
114114
using ValueType_impl = typename PairType::second_type; // container's value_type is always instantiation of std::pair
115115
using KeyType_impl = typename PairType::first_type;
116-
using NoPtrValueType_impl = typename std::remove_pointer<ValueType_impl>::type;
116+
using NoPtrValueType_impl = std::remove_pointer_t<ValueType_impl>;
117117
//! If T is pointer type, then ImmutableValueType_impl is `const U*` where U is type received by dereferencing operation on variable of type T.
118118
//! Otherwise (T is not pointer type) ImmutableValueType_impl is `const T`.
119119
using ImmutableValueType_impl =

include/nbl/core/math/glslFunctions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ template<class T>
161161
NBL_FORCE_INLINE T sign(const T& a)
162162
{
163163
auto isneg = a < T(0);
164-
using bool_type = typename std::remove_reference<decltype(isneg)>::type;
164+
using bool_type = std::remove_reference_t<decltype(isneg)>;
165165
T half_sign = core::mix<T,bool_type>(T(1),T(-1),isneg);
166166
auto iszero = a == T(0);
167167
return core::mix<T,bool_type>(half_sign,T(0),iszero);

include/nbl/core/math/glslFunctions.tcc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ template<typename T>
2727
NBL_FORCE_INLINE T abs(const T& a)
2828
{
2929
auto isneg = a < T(0);
30-
using bool_type = typename std::remove_reference<decltype(isneg)>::type;
30+
using bool_type = std::remove_reference_t<decltype(isneg)>;
3131
return core::mix<T,bool_type>(a,-a,isneg);
3232
}
3333

@@ -189,7 +189,7 @@ NBL_FORCE_INLINE T min(const T& a, const T& b)
189189
{
190190
T vb = T(b);
191191
auto asmaller = a<vb;
192-
using bool_type = typename std::remove_reference<decltype(asmaller)>::type;
192+
using bool_type = std::remove_reference_t<decltype(asmaller)>;
193193
return core::mix<T,bool_type>(vb,a,asmaller);
194194
}
195195

@@ -225,7 +225,7 @@ NBL_FORCE_INLINE T max(const T& a, const T& b)
225225
{
226226
T vb = T(b);
227227
auto asmaller = a < vb;
228-
using bool_type = typename std::remove_reference<decltype(asmaller)>::type;
228+
using bool_type = std::remove_reference_t<decltype(asmaller)>;
229229
return core::mix<T,bool_type>(a,vb,asmaller);
230230
}
231231

include/nbl/core/memory/new_delete.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,24 @@ struct NBL_API AlignedWithAllocator
100100

101101
//use these by default instead of new and delete, single object (non-array) new takes constructor parameters as va_args
102102
#define _NBL_NEW(_obj_type, ... ) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::VA_ARGS_comma_workaround(_NBL_DEFAULT_ALIGNMENT(_obj_type)).new_(__VA_ARGS__)
103-
#define _NBL_DELETE(_obj) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type> >::delete_(_obj)
103+
#define _NBL_DELETE(_obj) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>> >::delete_(_obj)
104104

105105
#define _NBL_NEW_ARRAY(_obj_type,count) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::new_array(count,_NBL_DEFAULT_ALIGNMENT(_obj_type))
106-
#define _NBL_DELETE_ARRAY(_obj,count) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference_t<typename std::remove_pointer_t<decltype(_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference_t<typename std::remove_pointer_t<decltype(_obj)>>> >::delete_array(_obj,count)
106+
#define _NBL_DELETE_ARRAY(_obj,count) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>> >::delete_array(_obj,count)
107107

108108
//! Extra Utility Macros for when you don't want to always have to deduce the alignment but want to use a specific allocator
109109
//#define _NBL_ASSERT_ALLOCATOR_VALUE_TYPE(_obj_type,_allocator_type) static_assert(std::is_same<_obj_type,_allocator_type::value_type>::value,"Wrong allocator value_type!")
110110
#define _NBL_ASSERT_ALLOCATOR_VALUE_TYPE(_obj_type,_allocator_type) static_assert(std::is_same<_obj_type,std::allocator_traits<_allocator_type >::value_type>::value,"Wrong allocator value_type!")
111111

112112
#define _NBL_NEW_W_ALLOCATOR(_obj_type,_allocator, ... ) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::VA_ARGS_comma_workaround(_NBL_DEFAULT_ALIGNMENT(_obj_type),_allocator).new_(__VA_ARGS__); \
113113
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(_obj_type,decltype(_allocator))
114-
#define _NBL_DELETE_W_ALLOCATOR(_obj,_allocator) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type> >::delete_(_obj,_allocator); \
115-
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type,decltype(_allocator))
114+
#define _NBL_DELETE_W_ALLOCATOR(_obj,_allocator) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>> >::delete_(_obj,_allocator); \
115+
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,decltype(_allocator))
116116

117117
#define _NBL_NEW_ARRAY_W_ALLOCATOR(_obj_type,count,_allocator) nbl::core::impl::AlignedWithAllocator<_obj_type,_NBL_DEFAULT_ALLOCATOR_METATYPE<_obj_type> >::new_array(count,_NBL_DEFAULT_ALIGNMENT(_obj_type),_allocator); \
118118
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(_obj_type,decltype(_allocator))
119-
#define _NBL_DELETE_ARRAY_W_ALLOCATOR(_obj,count,_allocator) nbl::core::impl::AlignedWithAllocator<typename std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type,_NBL_DEFAULT_ALLOCATOR_METATYPE<typename std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type> >::delete_array(_obj,count,_allocator); \
120-
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(std::remove_reference<typename std::remove_pointer<decltype(_obj)>::type>::type,decltype(_allocator))
119+
#define _NBL_DELETE_ARRAY_W_ALLOCATOR(_obj,count,_allocator) nbl::core::impl::AlignedWithAllocator<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,_NBL_DEFAULT_ALLOCATOR_METATYPE<std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>> >::delete_array(_obj,count,_allocator); \
120+
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,decltype(_allocator))
121121

122122

123123
namespace nbl

include/nbl/video/alloc/SubAllocatedDataBuffer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class NBL_API SubAllocatedDataBuffer : protected core::impl::FriendOfHeterogenou
9696
if (rangeData)
9797
{
9898
auto alloctr = sadbRef->getFunctorAllocator();
99-
alloctr.deallocate(reinterpret_cast<typename std::remove_pointer<decltype(alloctr)>::type::pointer>(rangeData),numAllocs);
99+
alloctr.deallocate(reinterpret_cast<std::remove_pointer_t<decltype(alloctr)>::pointer>(rangeData),numAllocs);
100100
}
101101
}
102102

@@ -106,7 +106,7 @@ class NBL_API SubAllocatedDataBuffer : protected core::impl::FriendOfHeterogenou
106106
if (rangeData) // could swap the values instead
107107
{
108108
auto alloctr = sadbRef->getFunctorAllocator();
109-
alloctr.deallocate(reinterpret_cast<typename std::remove_pointer<decltype(alloctr)>::type::pointer>(rangeData),numAllocs);
109+
alloctr.deallocate(reinterpret_cast<std::remove_pointer_t<decltype(alloctr)>::pointer>(rangeData),numAllocs);
110110
}
111111
sadbRef = other.sadbRef;
112112
rangeData = other.rangeData;
@@ -147,7 +147,7 @@ class NBL_API SubAllocatedDataBuffer : protected core::impl::FriendOfHeterogenou
147147
}
148148
};
149149
constexpr static bool UsingDefaultFunctor = std::is_same<CustomDeferredFreeFunctor,void>::value;
150-
using DeferredFreeFunctor = typename std::conditional<UsingDefaultFunctor,DefaultDeferredFreeFunctor,CustomDeferredFreeFunctor>::type;
150+
using DeferredFreeFunctor = std::conditional_t<UsingDefaultFunctor,DefaultDeferredFreeFunctor,CustomDeferredFreeFunctor>;
151151
GPUDeferredEventHandlerST<DeferredFreeFunctor> deferredFrees;
152152
core::allocator<std::tuple<size_type,size_type,void*> > functorAllocator; // TODO : CMemoryPool<RobustGeneralpurposeAllocator> a-la naughty do
153153
public:

src/nbl/asset/interchange/CGLTFLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ using namespace nbl::asset;
683683

684684
for (const auto& glTFprimitive : glTFMesh.primitives)
685685
{
686-
typedef std::remove_reference<decltype(glTFprimitive)>::type SGLTFPrimitive;
686+
std::remove_reference_t<decltype(glTFprimitive)> SGLTFPrimitive;
687687

688688
auto cpuMeshBuffer = core::make_smart_refctd_ptr<ICPUMeshBuffer>();
689689
cpuMeshBuffer->setPositionAttributeIx(SAttributes::POSITION_ATTRIBUTE_LAYOUT_ID);
@@ -710,7 +710,7 @@ using namespace nbl::asset;
710710
const auto& globalOffsetInBufferBindingResource = glTFbufferView.byteOffset.has_value() ? glTFbufferView.byteOffset.value() : 0u;
711711
const auto& relativeOffsetInBufferViewAttribute = glTFAccessor.byteOffset.has_value() ? glTFAccessor.byteOffset.value() : 0u;
712712

713-
typedef std::remove_reference<decltype(glTFbufferView)>::type SGLTFBufferView;
713+
std::remove_reference_t<decltype(glTFbufferView)> SGLTFBufferView;
714714

715715
auto setBufferBinding = [&](uint32_t target) -> void
716716
{

0 commit comments

Comments
 (0)