Yes, there is original implementation of the STL by Alexander Stepanov and Meng Lee. It is the most readable STL implementation I have ever seen. You can download it from here.
Below is an implementation of pair. Note how readable the source code really was:
#include
template
struct pair {
T1 first;
T2 second;
pair() {}
pair(const T1& a, const T2& b) : first(a), second(b) {}
};
template
inline bool operator==(const pair& x, const pair& y) {
return x.first == y.first && x.second == y.second;
}
template
inline bool operator<(const pair& x, const pair& y) {
return x.first < y.first || (!(y.first < x.first) && x.second < y.second);
}
template
inline pair make_pair(const T1& x, const T2& y) {
return pair(x, y);
}
Back to the roots!