S
saneman
I am writing a class 'seq' that calls begin() and begin() const in
std::list:
template <typename V, typename A> typename seq<V,A>::iterator
seq<V,A>::seqbegin() {
return seq::list.begin();
}
// const version.
template <typename V, typename A> typename seq<V,A>::const_iterator
seq<V,A>::seqbegin() const {
return seq::list.begin();
}
But how do make sure that:
return seq::list.begin();
in 'seqbegin() const' actually returns the const_iterator from the
std::list?
Is it enough that I declare the function to return a const_iterator?
std::list:
template <typename V, typename A> typename seq<V,A>::iterator
seq<V,A>::seqbegin() {
return seq::list.begin();
}
// const version.
template <typename V, typename A> typename seq<V,A>::const_iterator
seq<V,A>::seqbegin() const {
return seq::list.begin();
}
But how do make sure that:
return seq::list.begin();
in 'seqbegin() const' actually returns the const_iterator from the
std::list?
Is it enough that I declare the function to return a const_iterator?