T
Taras_96
Hi everyone,
I came across the following:
" * There is also a third version for pointers to const to remove
the const from the value type.
template <class T>
struct iterator_traits<const T*> {
typedef T value_type;
};
" - http://www.cs.helsinki.fi/u/tpkarkka/alglib/k06/lectures/iterators.html#other-associated-types
However, the site at http://msdn2.microsoft.com/en-us/library/zdxb97eh(VS.71).aspx
shows that:
"template<class Type>
struct iterator_traits<const Type*> {
typedef random_access_iterator_tag iterator_category;
typedef Type value_type;
typedef ptrdiff_t difference_type;
typedef const Type *pointer;
typedef const Type& reference;
};" (ie: the const is in the typedef)
Which one is correct?
Thanks
Taras
I came across the following:
" * There is also a third version for pointers to const to remove
the const from the value type.
template <class T>
struct iterator_traits<const T*> {
typedef T value_type;
};
" - http://www.cs.helsinki.fi/u/tpkarkka/alglib/k06/lectures/iterators.html#other-associated-types
However, the site at http://msdn2.microsoft.com/en-us/library/zdxb97eh(VS.71).aspx
shows that:
"template<class Type>
struct iterator_traits<const Type*> {
typedef random_access_iterator_tag iterator_category;
typedef Type value_type;
typedef ptrdiff_t difference_type;
typedef const Type *pointer;
typedef const Type& reference;
};" (ie: the const is in the typedef)
Which one is correct?
Thanks
Taras