다음을 통해 공유


CAtlList::IsEmpty

목록이 비어 있는 경우 확인 하려면이 메서드를 호출 합니다.

bool IsEmpty( ) const throw( );

반환 값

목록 개체, 그렇지 않으면 false를 포함 하는 경우 true를 반환 합니다.

예제

// Define the integer list
CAtlList<int> myList;

// Populate the list
myList.AddTail(1);
myList.AddTail(2);
myList.AddTail(3);
myList.AddTail(4);

// Confirm not empty
ATLASSERT(myList.IsEmpty() == false);

// Remove the tail element
myList.RemoveTailNoReturn();

// Confirm not empty
ATLASSERT(myList.IsEmpty() == false);

// Remove the head element
myList.RemoveHeadNoReturn();

// Confirm not empty
ATLASSERT(myList.IsEmpty() == false);

// Remove all remaining elements
myList.RemoveAll();

// Confirm empty
ATLASSERT(myList.IsEmpty() == true);   

요구 사항

헤더: atlcoll.h

참고 항목

참조

CAtlList 클래스

CAtlList::GetCount