Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CObList::RemoveTail
CObList                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  CObject* RemoveTail();
 
  Remarks
 
  Removes the element from the tail of the list and returns a pointer to
  it.
 
  You must ensure that the list is not empty before calling RemoveTail. If
  the list is empty, then the Debug version of the library asserts. Use
  IsEmpty to verify that the list contains elements.
 
  Return Value
 
  A pointer to the object that was at the tail of the list.
 
  Example
 
  CObList list;
  CAge* pa1;
  CAge* pa2;
 
  list.AddHead( pa1 = new CAge( 21 ) );
  list.AddHead( pa2 = new CAge( 40 ) ); // List now contains (40, 21)
  ASSERT( *(CAge*) list.RemoveTail() == CAge( 21 ) );  // Old tail
  ASSERT( *(CAge*) list.GetTail() == CAge( 40 ) );  // New tail
  delete pa1;
  delete pa2; // Clean up memory
 
 
  See Also
 
  CObList::GetTail, CObList::AddTail
 
 
                                     -♦-