This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Query regarding libstdc++ std::list internal end() representation


Hi there-
in order for --end() to function correctly, end() must point to an actual node.

Two questions:
1. I couldn't find the definition for list nodes when searching through the headers, does libstdc++ use nodes of the form:
struct node
{
	T *element;
	node *prev, *next;
}

or

struct node
{
	T element;
	node *prev, *next;
}
?


2. If the second is true, how does the end iterator avoid the allocation of an unused element?
Thanks-
Mat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]