简体   繁体   中英

aside default allocator, does stl has other allocators now?

Stl default allocator, defined in allocator.h, is a simple wrapper of new, delete operator. Does stl has some other allocators, for example, memory-pool based allocator? If it has, which head file it is defined.

I explored the stl source code(4.1.1) and googled it, but can find anything.

Regarding whether the standard library supplies more allocator templates than std::allocator (disregarding the wrapper std::scoped_allocator_adapter ), searching through the C++11 PDF didn't find any.


In other non-news…

The STL, the Standard Template Library , is not the same as the C++ standard library . The STL started as an Ada library (IIRC), developed by Stepanov. Stepanov and Stroustrup jointly proposed inclusion of most of the C++ version of STL into the standard library of the first C++ standardization, in 1998, and it was adopted. This part of the standard library is mainly about the iterators and algorithms.

Perusing the source code of some standard library implementation is not a good way to establish what functionality is standard. For that, the relevant standard is the authoritative source. But also sites like cppreference can be useful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM