Hi, I am working on an assignment to create a circular doubly-linked list.
One class member method I must include is
"const T& curr() const;
? return the data at the node curr_ is pointing at. If curr is NULL, function returns a default instance of the unknown data type
i>
I am slightly confused by what the assignment spec means by returning a default instance
My code consists of
template <class T>
const T& CList<T>::curr() const{
return (curr_)?curr_->data_:
//TODO: What is the other return (else condition)
}
Question
AaronMT
Hi, I am working on an assignment to create a circular doubly-linked list.
One class member method I must include is
"const T& curr() const;
? return the data at the node curr_ is pointing at. If curr is NULL, function returns a default instance of the unknown data type
i>
I am slightly confused by what the assignment spec means by returning a default instance
My code consists of
What am I returning if curr_ is NULL?
Link to comment
https://www.neowin.net/forum/topic/496662-c-linked-list-template-class-question/Share on other sites
1 answer to this question
Recommended Posts