• 0

[C++] Linked List Template Class Question


Question

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)
}

What am I returning if curr_ is NULL?

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.