
15 Oct
2009
15 Oct
'09
12:02 a.m.
Sid Sacek a écrit :
I'm going to take a guess. Of course, this is all contingent on whether T is a class that contains a destructor, otherwise all bets are off. -Sid Sacek
[...] T * tp = new T[ 100 ];
size_t array_size = reinterpret_cast< size_t * >( tp )[ -1 ];
I think this is not going to work if T has a stricter alignment than size_t.