Просмотр исходного кода

Merge pull request #190 from jonesmz/static_constexpr_max_size

Make member function StdAlloc::max_size into a static constexpr function
Marko Pintera 7 лет назад
Родитель
Сommit
c3b5652727
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Source/BansheeUtility/Allocators/BsMemoryAllocator.h

+ 1 - 1
Source/BansheeUtility/Allocators/BsMemoryAllocator.h

@@ -421,7 +421,7 @@ namespace bs
 			bs_free<Alloc>((void*)p);
 			bs_free<Alloc>((void*)p);
 		}
 		}
 
 
-		size_t max_size() const { return std::numeric_limits<size_type>::max() / sizeof(T); }
+		static constexpr size_t max_size() noexcept { return std::numeric_limits<size_type>::max() / sizeof(T); }
 		void construct(pointer p, const_reference t) { new (p) T(t); }
 		void construct(pointer p, const_reference t) { new (p) T(t); }
 		void destroy(pointer p) { p->~T(); }
 		void destroy(pointer p) { p->~T(); }
 		/* This version of construct() (with a varying number of parameters)
 		/* This version of construct() (with a varying number of parameters)