S
Saeed Amrollahi
Dear all
hi
There are a lot of typedefs in standard library containers. For
example:
template<class T, class A = allocator<T> >
class vector {
typedef T value_type;
typedef A allocator_type;
typedef typename A:ointer pointer; // pointer to
element
typedef typename A::const_pointer const_pointer;
typedef typename A::reference reference; // reference to element
typedef typename A::const_reference const_reference;
// ...
};
There are similar declarations in other containers like valarray,
list, map, ...
What are they? What are the benfits of such declarations?
Thanks in advance,
-- Saeed Amrollahi
hi
There are a lot of typedefs in standard library containers. For
example:
template<class T, class A = allocator<T> >
class vector {
typedef T value_type;
typedef A allocator_type;
typedef typename A:ointer pointer; // pointer to
element
typedef typename A::const_pointer const_pointer;
typedef typename A::reference reference; // reference to element
typedef typename A::const_reference const_reference;
// ...
};
There are similar declarations in other containers like valarray,
list, map, ...
What are they? What are the benfits of such declarations?
Thanks in advance,
-- Saeed Amrollahi