JX Wang
JX Wang

Categories

  • Programming

Tags

  • c++
  • memory_leak

https://github.com/jaxonwang/thallium/commit/e7f51e391d05098666ec9123b8bbf9b9f44a2cc7

unique_ptr p{new int[10]{}}; ///!!!

Stupid but need to be carefull enough.

std::make_unique in c++14 is prefered:

make_unique<int[]>(10);

This will make 10 size array of int