I came across this code in boost/checked_delete.hpp
Can somebody explain what are line#1 and line#2 doing?
template<class T> inline void checked_array_delete(T * x)
{
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ]; #1
(void) sizeof(type_must_be_complete); #2
delete [] x;
}
From this page, I got this info regarding their purpose,
T must be a complete type. The expression delete [] p must be well-formed.
but, what is a complete type in C++?