I was curious what the stl-compatible container entails (or is compatible with boost compatibility, I understand that they are either the same or very similar). I saw several examples of what people call stl-compatible (for example, this code in codeproject and, obviously, the actual stl-containers), but I'm not quite sure which components of these containers I need to have.
From what I could assemble, I need at least the following:
STL compatible iterators (the current stl uses only bidirectional or higher iterators, I don’t know if this is a requirement or just happens - a chance, still figuring out what to consider as a “stl compatible iterator”)
The mechanism for defining distributors (by default std::allocator ), as well as their proper use (still trying to figure out what this last part means)
public typedefs for metaprogramming (pointer type, constant pointer type, reference type, value type, reference constant type, difference type, maybe some others?). Side question: what is the difference type ?
'generic' (i.e. uses metaprogramming / templates so that the container can store almost any type)
Is there anything else that I missed or, even worse, was mistaken in the above list (maybe things like const-correctness, thread safety, exception generation / handling, etc.)? Also, is there a document specification somewhere, detailing what is required if such a thing even exists?
source share