fork download
  1. #include <new>
  2. #include <utility>
  3.  
  4. int main() {
  5. using T = int;
  6. typename std::aligned_storage<sizeof(T), alignof(T)>::type storage;
  7. new (&storage) T();
  8.  
  9. //(...)
  10.  
  11. //delete reinterpret_cast<T*>(&storage);
  12. //vs
  13. //reinterpret_cast<T&>(storage).~T();
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty