There is a book The C++ Standard Template Library, co-authored by the original STL designers Stepanov & Lee (together with P.J. Plauger and David Musser), which describes a possible implementation, complete with code – see http://www.amazon.co.uk/C-Standard-Template-Library/dp/0134376331.