Руководство по стандартной библиотеке шаблонов STL

         

Распределитель по умолчанию (The default allocator)


template class allocator { public: typedef T* pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; typedef T value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; allocator(); ~allocator(); pointer address(reference x); const_pointer const_address(const_reference x); pointer allocate(size_type n); void deallocate(pointer p); size_type init_page_size(); size_type max_size(); }; class allocator { public: typedef void* pointer; allocator(); ~allocator(); };

    Предполагается, что в дополнение к allocator поставщики библиотеки обеспечивают распределители для всех моделей памяти.



Содержание раздела