Name: Anonymous 2015-04-25 6:26
Meanwhile if you can use templates then you can define a function like this:—http://genesisdaw.org/post/progress-so-far.htmlNow you can't mess it up, the compiler does the work for you.template<typename T>
__attribute__((malloc)) static inline T * allocate(size_t count) {
return reinterpret_cast<T*>(malloc(count * sizeof(T)));
}