Ian Griffiths said:
This is exactly equivalent to a C++ typedef though.
Jon mentioned the non-global nature of such a using directive, but what he
didn't mention is that it's no different in C++. A C++ typedef also only has
any effect in the compilation units in which it appears.
Just a minor nitpick, but they aren't *exactly* the same. In C++ you can use
typedefs in class or struct scope like so:
template <class Iterator>
struct iterator_traits {
typedef typename Iterator::iterator_category iterator_category;
typedef typename Iterator::value_type value_type;
typedef typename Iterator::difference_type difference_type;
typedef typename Iterator:

ointer pointer;
typedef typename Iterator::reference reference;
};
These types can then be referred to from outside of the scope. C#'s type
aliasing mechanism does not allow aliasing within a class (or struct) scope.
I do miss typedef's since moving from C++ to C#. With generics in C# 2.0,
the need for typedefs is only going to grow.
Regards,
Sami