From a82b87c46ee25b26f819c36046962786e5d49fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 31 Aug 2022 22:02:46 -0700 Subject: [PATCH] Cleanup. --- include/bx/inline/sort.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/bx/inline/sort.inl b/include/bx/inline/sort.inl index 1a17644..9fccb8c 100644 --- a/include/bx/inline/sort.inl +++ b/include/bx/inline/sort.inl @@ -38,12 +38,14 @@ namespace bx template void quickSort(Ty* _data, uint32_t _num, const ComparisonFn _fn) { + BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); quickSort( (void*)_data, _num, sizeof(Ty), _fn); } template void quickSort(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn) { + BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); quickSort(_data, _num, _stride, _fn); } @@ -167,6 +169,8 @@ done: template inline void radixSort(uint32_t* _keys, uint32_t* _tempKeys, Ty* _values, Ty* _tempValues, uint32_t _size) { + BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); + uint32_t* keys = _keys; uint32_t* tempKeys = _tempKeys; Ty* values = _values; @@ -301,6 +305,8 @@ done: template inline void radixSort(uint64_t* _keys, uint64_t* _tempKeys, Ty* _values, Ty* _tempValues, uint32_t _size) { + BX_STATIC_ASSERT(isTriviallyMoveAssignable(), "Sort element type must be trivially move assignable"); + uint64_t* keys = _keys; uint64_t* tempKeys = _tempKeys; Ty* values = _values;