/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.09.12 * * ³» ¿ë : ¸Þ¸ð¸® ÇÒ´çÀÚ ÅÛÇø´ * Ãß°¡³»¿ë : * ÀÛ¾÷ÀÏ ÀÛ¾÷ÀÚ ÀÛ¾÷³»¿ë * * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include /// ¸Þ¸ð¸® ÇÒ´çÀÚ /// ´Ü¼øÈ÷ ¸Þ¸ð¸®¸¦ ÇÒ´ç, ÇØÁ¦ÇÏ´Â ¿ªÇÒÀ» ¼öÇàÇÑ´Ù. template class tAllocator { public: /// n°³ÀÇ ¿ø¼Ò¿¡ ´ëÇØ ÇÊ¿äÇÑ ¸Þ¸ð¸®¸¦ ÇÒ´ç static T* Allocate( unsigned int n ) { if( n ) { return (T*)operator new( n * sizeof(T) ); } return 0; } /// ¸Þ¸ð¸®¸¦ ÇØÁ¦ static void Deallocate( T* p ) { operator delete( p ); } };