指定した要素をリストの先頭に移動します。
void MoveToHead(
POSITION pos
) throw( );
パラメーター
- pos
移動する要素の POSITION 値。
解説
指定された要素を現在の位置からリストの先頭へ移動します。 デバッグ ビルドでは、pos が NULL である場合にアサーション エラーが発生します。
使用例
// Define the integer list
CAtlList<int> myList;
// Populate the list
myList.AddTail(1);
myList.AddTail(2);
myList.AddTail(3);
myList.AddTail(4);
// Move the tail element to the head
myList.MoveToHead(myList.GetTailPosition());
// Confirm the head is as expected
ATLASSERT(myList.GetHead() == 4);
// Move the head element to the tail
myList.MoveToTail(myList.GetHeadPosition());
// Confirm the tail is as expected
ATLASSERT(myList.GetTail() == 4);
必要条件
**ヘッダー:**atlcoll.h