Advertisement
AI_UBI

Dtor function for range based dynamic vector

Mar 10th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. template<typename T>
  2. inline void vector<T>::call_dtor_in_range(const size_type & start, const size_type & end)
  3. {
  4.     for (size_type I = start; I < end; ++I)
  5.     {
  6.         if (!std::is_pod<T>::value && std::is_destructible<T>::value && !std::is_pointer<T>::value)
  7.         {
  8.             m_Data[I].~T();
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement