무엇 :: 줄에 : return :: operator new (size, :: std :: nothrow); 왜 이런::
가 글로벌operator new
및 operator delete
함수가 호출되는 것을 의미 범위 결정 연산자를 사용하여 템플릿 형 TC에서 범위 해결 연산자에 대한 혼동
template<typename T>
class DefaultMemoryAllocator
{
public:
static inline void *Allocate(size_t size)
{
return ::operator new(size, ::std::nothrow);
}
static inline void Deallocate(void *pointer, size_t size)
{
::operator delete(pointer);
}
};
"범위 분석 연산자"입니다. 그 이유는 여기에 설명되어 있습니다. http://stackoverflow.com/questions/4173254/what-is-the-curiously-recurring-template-pattern-crtp – StoryTeller