STL中的for_each输出链表元素

为什么出不来结果??

#include<iostream>
#include<list>
#include<algorithm>
using namespace std;
void Print(int &item)
{
  cout<<item<<" ";
}

int main()
{
  list<int> listintegers;
    //------------头插法插入元素-------------
  listintegers.push_front(5);
  listintegers.push_front(3);

   //----------尾插法插入元素----------
  listintegers.push_back(6);

  //输出链表元素 
  std::for_each(listintegers.begin(),listintegers.begin(),Print);
  cout<<endl;
  system("pause");
  return 0;
}

图片说明

for_each的第二个参数应该是listinteger.end()

//std::for_each(listintegers.begin(),listintegers.begin(),Print);
这句两个迭代器都是头啊,得有一个end吧