12345678910111213141516
#include <fstream> #include <iterator> #include <algorithm> #include <iostream> #include <list> typedef int Data; typedef std::list < Data > DataList; int main() { DataList data((std::istream_iterator < DataList::value_type > (std::ifstream("data.txt"))), std::istream_iterator < DataList::value_type > ()); return 0; }