I am working on optimizing my smart pointer in my C++ library. The pointer has, besides from the built-in pointer and reference count, a boolean stating whether the pointer is scalar or array (i.e. it was allocated with new or new[] operator). The destructor of the class then uses this boolean the figure out which type of deallocation to perform (delete or delete[], respectively).
Specifying this boolean manually seems a little weird, so I was wondering, if there is a way to do this implicitly.
Full code on Github.