[llvm-commits] CVS: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp lists1.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Oct 6 20:04:01 PDT 2003
Changes in directory llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++:
lists.cpp updated: 1.1 -> 1.2
lists1.cpp updated: 1.1 -> 1.2
---
Log message:
iota is a historical oddity from the SGI STL, it is not part of the standard
---
Diffs of the changes: (+21 -5)
Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp
diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.2
--- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.1 Mon Oct 6 20:02:35 2003
+++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists.cpp Mon Oct 6 20:03:17 2003
@@ -1,5 +1,5 @@
// -*- mode: c++ -*-
-// $Id: lists.cpp,v 1.1 2003/10/07 01:02:35 lattner Exp $
+// $Id: lists.cpp,v 1.2 2003/10/07 01:03:17 lattner Exp $
// http://www.bagley.org/~doug/shootout/
// from Bill Lear
@@ -11,10 +11,18 @@
const size_t SIZE = 10000;
+template <class _ForwardIterator, class _Tp>
+void
+iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
+{
+ while (__first != __last)
+ *__first++ = __value++;
+}
+
size_t test_lists() {
std::list<size_t> li1(SIZE);
- std::iota(li1.begin(), li1.end(), 1);
+ iota(li1.begin(), li1.end(), 1);
std::list<size_t> li2(li1);
Index: llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp
diff -u llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.1 llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.2
--- llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.1 Mon Oct 6 20:00:44 2003
+++ llvm/test/Programs/SingleSource/Benchmarks/Shootout-C++/lists1.cpp Mon Oct 6 20:03:17 2003
@@ -1,10 +1,18 @@
// -*- mode: c++ -*-
-// $Id: lists1.cpp,v 1.1 2003/10/07 01:00:44 lattner Exp $
+// $Id: lists1.cpp,v 1.2 2003/10/07 01:03:17 lattner Exp $
// http://www.bagley.org/~doug/shootout/
#include <iostream>
#include <list>
#include <numeric>
+
+template <class _ForwardIterator, class _Tp>
+void
+iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
+{
+ while (__first != __last)
+ *__first++ = __value++;
+}
using namespace std;
More information about the llvm-commits
mailing list