Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ templates

Name: Anonymous 2015-04-25 6:26

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

Name: Anonymous 2015-04-25 9:26

>>2
I want to code
This board is not for the likes of you, coder.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List