次の方法で共有


CList::IsEmpty

Indicates whether this list contains no elements.

BOOL IsEmpty( ) const;

Return Value

Nonzero if this list is empty; otherwise 0.

Example

// Define myList.
CList<CString,CString&> myList;

// Add three elements to the list.
myList.AddTail(CString(_T("XYZ")));
myList.AddTail(CString(_T("ABC")));
myList.AddTail(CString(_T("123")));

// Remove the head element until the list is empty.
CString str;
while (!myList.IsEmpty())
{
   str = myList.RemoveHead();
   TRACE(_T("%s\r\n"), (LPCTSTR) str);
}      

Requirements

Header: afxtempl.h

See Also

Reference

CList Class

Hierarchy Chart

CList::GetCount