Pārlūkot izejas kodu

make small_vector works with pod

blueloveTH 1 gadu atpakaļ
vecāks
revīzija
3dafa7573c
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      include/pocketpy/common/vector.hpp

+ 2 - 0
include/pocketpy/common/vector.hpp

@@ -284,6 +284,8 @@ struct vector {
 
 template <typename T, std::size_t N>
 struct small_vector {
+    static_assert(is_pod_v<T>);
+    
     alignas(T) char _buffer[sizeof(T) * N];
     T* _begin;
     T* _end;