I've been curious as to what entails an stl-compliant container (or boost-compliant, my understanding is that their either the same, or very similar). I've seen a few examples of what people call stl-compliant (for example, this one over at codeproject, and obviously the actual stl containers), but I'm not exactly sure what components of those containers I need to have.
From what i could gather, I need at least these things:
STL-compliant Iterators (the current stl only uses bi-directional or higher iterators, don't know if this is a requirement or just happens-chance, still figuring out what's necessary to be considered a "stl-compliant iterator")
Mechanism for defining allocators (default to
std::allocator
), as well as using them correctly (still trying to figure out what this last part means)public typedefs for metaprogramming (pointer type, const pointer type, reference type, value type, const reference type, difference type, maybe some others?). Side question: What is a
difference type
?'generic' (i.e. uses metaprogramming/templates to make the container able to hold pretty much any type)
Is there anything else I've missed, or worse, got wrong in the above list (perhaps things such as const-correctness, thread safety, exceptions generation/handling, etc.)? Also, is there a specifications doc somewhere detailing what is required, if such a thing even exists?
for
syntax". – Mike DeSimone