Recently I picked up the habit of typedefing various types within template classes, as is done in the standard library. For example, a container class might look something along the lines of:template<typename T>class custom_container {public:    typedef T value_type;    typedef value_type* pointer;    typedef value_type& reference;    typedef std::size_t size_type;    reference operator[](size_type);    // etc...};However, after a while of using this, I began to question if it's really such a good idea, despite supposedly increasing readability and expression of intent. It seems counter-intuitive that one would alias, say, T to another type, since isn't anyone using the class expecting the value_type to be T, and only ever T anyway (it is a custom_container<T> after all)? Similarly, would users of such a class not always expect pointer to be T* and reference to be T&?  We make use of typedefs to allow for ease of changing some aliased type to another if required, yet in the majority of the cases I come across, said typedefs are redundant, and almost confusing, as it would never make sense to have the alias synonymise any other type. custom_container probably wouldn't be fulfilling its expectations if value_type was changed to anything else than T - the user expects it is some sort of container of Ts.Therefore, is it still useful and/or good design to make heavy use of typedefs in template classes as done in the standard library?
Use of public typedefs in template class types
c++;class design;typedef