libshit

Just some random shit
git clone https://git.neptards.moe/neptards/libshit.git
Log | Files | Refs | Submodules | README | LICENSE

memory (301B)


      1 // -*- c++ -*-
      2 #pragma once
      3 
      4 #include_next <memory>
      5 
      6 namespace std
      7 {
      8 
      9   template <typename T>
     10   constexpr void destroy_at(T* ptr) { ptr->~T(); }
     11 
     12   template <typename It>
     13   constexpr void destroy(It begin, It end)
     14   {
     15     for (; begin != end; ++begin)
     16       destroy_at(std::addressof(*begin));
     17   }
     18 
     19 }